Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id f6U4aOc23391 for info-inventor-dev-outgoing; Sun, 29 Jul 2001 21:36:24 -0700 Received: from VL-MS-MR002.sc1.videotron.ca (relais.videotron.ca [24.201.245.36]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id f6U4aMV23387 for ; Sun, 29 Jul 2001 21:36:22 -0700 Received: from riemann.nyongwa.montreal.qc.ca ([24.200.217.26]) by VL-MS-MR002.sc1.videotron.ca (Netscape Messaging Server 4.15) with ESMTP id GH9R9J00.JN1; Mon, 30 Jul 2001 00:32:07 -0400 Received: from steve by riemann.nyongwa.montreal.qc.ca with local (Exim 3.31 #1 (Debian)) id 15R4is-0003e0-00; Mon, 30 Jul 2001 00:32:06 -0400 Date: Mon, 30 Jul 2001 00:32:06 -0400 To: OpenInventor devel mailing list Cc: angbodhi@pacific.net.sg Subject: freetype libFL wrapper Message-ID: <20010730003206.H23031@nyongwa.montreal.qc.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.18i From: "Steve M. Robbins" Sender: owner-info-inventor-dev@oss.sgi.com Precedence: bulk Hi, I'm compiling OpenInventor on linux, using "angbodhi"'s libFL wrapper library included in the inventor sources. If I run "ivview jackInTheBox.iv", absolutely nothing comes in the window. However, if I remove the "string [...]" lines from the SoText2 node in the .iv file, it works. Eventually, I discovered that it is the space character that causes the problem. With any SoText2 node, if the string is "abc", the text displays OK. If I change the text to "a b", then the inventor window comes up blank. [I'm using Utopia-Regular font, symlinked to /usr/lib/X11/fonts/Type1/UTRG____.pfa, a file that comes from xfree86 4.0.3.] After some poking around, I discovered something odd about the libFL wrapper. If anyone can shed light on this, I'll be grateful. In the file flfreetype.c, function _flFTGetBitmap(), there is code that creates a bitmap structure for outline fonts, something like: ... bbox_width = BM_TRUNC(face->bbox.xMax - face->bbox.xMin); ... bit3->xmove = width > 0 ? width : (bbox_width / 2.0); which seems quite reasonable. For the space character, both the height and width are zero, so the xmove field gets set to bbox_width/2. For some reason, this value turns out to be outrageously large: something over 600,000. I changed the line to read bit3->xmove = width > 0 ? width : 10; and it "works" in that I can render SoText2 nodes with spaces in the string. Clearly this is not the right fix. Help! -Steve -- by Rocket to the Moon, by Airplane to the Rocket, by Taxi to the Airport, by Frontdoor to the Taxi, by throwing back the blanket and laying down the legs ... - They Might Be Giants