freetype
[Top][All Lists]
Advanced

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

[ft] Getting same metrics in FreeType for code points with same glyph bu


From: Josh Sanford
Subject: [ft] Getting same metrics in FreeType for code points with same glyph but different position
Date: Mon, 22 May 2017 09:45:54 -0400

While using FreeType to render text in my software, I noticed that the
ellipsis character is aligned with the midline of my text rather than the
baseline.

The ellipsis is identical in appearance to another glyph in the same font.
The two code points are these:

   - U+2026: "…" Unicode 'HORIZONTAL ELLIPSIS'
   - U+22EF: "⋯" Unicode 'MIDLINE HORIZONTAL ELLIPSIS'

It is unsurprising that these two code points share the same glyph, but
their metrics ought to be different since they have different vertical
positioning.

The observed behavior is the same with and without the use of FreeType's
caching subsystem.  With the caching, I use FTC_SBitCache_LookupScaler() to
obtain an sbit, and I derive the metrics from the sbit.  Without the
caching, I use FT_Load_Glyph() and I derive the metrics from the slot
bitmap.  I am not surprised that height is the same for both codepoints
since the resulting bitmaps are identical, but I would expect top to be
different.  My observation however is that *all* of the metrics are
identical for both code points.

When I use these same code points in another program, they each display at
their correct vertical positions, so I know the problem is with my code and
not with the font.  Am I supposed to obtain my metrics from something other
than the sbit?


reply via email to

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