freetype
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ft] Glyph's Bitmap Beyond Ascender


From: Mickey Gabel
Subject: [ft] Glyph's Bitmap Beyond Ascender
Date: Sun, 08 Jun 2008 15:07:48 +0300
User-agent: Thunderbird 2.0.0.14 (Windows/20080421)

Hello, again.

I've encountered a strange problem, where it appears as if a glyph is rendered beyond the maximum ascender, as well as the maximum bbox as reported by the FaceRec. I understand that ascender is not always reliable, but as I understand from the docs, the bbox IS reliable.

I'll try to get a small reproducible code, but it will probably take some time, for now here is some information:

* FreeType 2.3.5.
* I don't use the patented hinter (ft_option.h is the default one).
* Font is "JI-acinic.ttf" (which probably came with some software I installed). * I haven't set any transformation, and all my own transformation use whole pixels, no fractionals. I also make sure to round, ceil or floor all vectors from FT2 (even though it seems those I get are rounded anyway).
* The I use Set_Char_Size with 32pt x 32pt, resolution 96x96 dpi.
* Antialiasing is on, so is hinting.
* FreeType reports ascender of 35. Going by face->bbox we get yMax of 813, which makes sense (1000 units per em, 43 pixels per em, 813 * 43 / 1000 gives 34.959). * When rendering lowercase 'e', I give FT_Glyph_To_Bitmap() an origin vector with y = 9 * 64. There are no other transformations or translations using FT.

Therefore I expect that bitmap_glyph->top will be 44 or smaller (9 + 35 is 44). However, I get top of 45, which means that the 'e' character rises beyond its ascender AND beyond the bbox (converting the yMax to font units, we get 1046 == 45 * 1000 / 43, which is beyond the 813 reported by the FaceRec).

Turning off hinting using FT_LOAD_NO_HINTING does help, but the ascender is already rounded up (34.969 --> 35), as suggested in the Glyph Convention doc. Could hinting move it up even more?

I do need a reliable way to figure out the maximum character height for a face before loading glyphs (to allocate images, for example, and for layout).

Am I doing something wrong? Is this a bug? Any ideas?

Thanks,
        Mickey





reply via email to

[Prev in Thread] Current Thread [Next in Thread]