By the way, when I write "bitmap" I mean "BMP file format", not glBitmap() format, which does use lower-left origin.
On Fri, Sep 23, 2011 at 2:58 PM, Patrick Baggett <[email protected]>wrote: > The baseline is a point you give. The coordinates for the glyph are > relative to an origin. So the punctuation should be just a small bit off > from the baseline. If you set your baseline to be (0,0), then it *bitmap* > space, > you're in the upper left. Increasing Y moves you down, but in font terms it > moves you up (Cartesian coords). Maybe the difference there has something to > do with it. The baseline for your font really should be lower, say for 16px > font, at (x,15). > > In other words, if you render a 16pt glyph at (0,0), move over say, 12 > pixels to (12,0), render another 16pt glyph, and so on, you get this: > > (0,0) +X > 0---------- > | G1| G2| > | |---+ > |---+ > | > +Y > > > You need to make sure that you actually copy the rendered glyphs to some > position on the bitmap so the bottom of the rect of th glyph is always on > teh baseline, and the baseline should always start at FONT_PIXELS_HEIGHT > below 0, i.e. if your largest font glyph can be 16 pixels tall, you need to > use 15 as a baseline Y so that [0,15] can be filled. > > Patrick > > > http://www.freetype.org/freetype2/docs/glyphs/glyphs-3.html > > On Fri, Sep 23, 2011 at 12:12 PM, Farmer, Anthony < > [email protected]> wrote: > >> Hello.**** >> >> ** ** >> >> I’m trying to load a font into a bitmap, then into an OpenGL texture for >> rendering, and have encountered a problem with the font baseline that I’m >> unable to resolve via online documentation or Google search. Attached is a >> small bitmap showing what happens, which hopefully obviates what I’m doing >> wrong and how it can be corrected.**** >> >> ** ** >> >> Briefly, I convert all the glyphs to bitmap glyphs then extract them >> sequentially into an OpenGL texture. Later I use the X-offset into that >> texture for rendering text. Unfortunately all the punctuation is being >> placed at the TOP of the GL texture, as if the baseline were there instead >> of along the bottom. I don’t believe that’s the case, but that’s the >> behavior.**** >> >> ** ** >> >> If there were some way I could extract the vertical location of the face’s >> BASELINE, I could adjust everything accordingly as glyphs are extracted. >> But I see no way to get that baseline value.**** >> >> ** ** >> >> Or perhaps there’s another approach altogether that I should be taking?** >> ** >> >> ** ** >> >> Thanks,**** >> >> Anthony Farmer**** >> This e-mail is confidential. If you are not named above as an addressee >> or are not the intended recipient of this e-mail, please notify the sender >> and immediately delete it. >> E-mails are susceptible to data corruption, interception, falsification, >> delay, unauthorised amendment and viruses. You should therefore carry out >> such virus and other checks as you consider appropriate. Cantor Gaming does >> not accept liability for any such events or any consequences thereof in >> respect of e-mails sent or received. Copyright and any other intellectual >> property rights in its contents are the sole property of Cantor Gaming. >> The contents of e-mails may be monitored for security purposes. Any views >> expressed in this message are those of the individual sender, except where >> the sender specifically states them to be the views of Cantor Gaming. >> This email was sent to you by Cantor Gaming. Cantor Gaming is the trading >> name of Cantor G&W Nevada L.P., a Nevada limited partnership with offices >> located at 135 East 57th Street, New York, New York 10022, and Cantor G&W >> International L.P., a limited partnership registered in England (registered >> number LP010479) with registered office One Churchill Place, Canary Wharf, >> London E14 5RD. >> >> _______________________________________________ >> Freetype mailing list >> [email protected] >> https://lists.nongnu.org/mailman/listinfo/freetype >> >> >
_______________________________________________ Freetype mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/freetype
