(
Jump to the original submission)
Mon 26 Sep 2016 06:39:22 AM UTC, comment #6:
OK, closing.
|
Mon 26 Sep 2016 06:26:39 AM UTC, comment #5:
Thanks for the pointers! It was my bug; fixed.
|
Wed 21 Sep 2016 08:34:16 AM UTC, comment #4:
Indeed, there are problems.
https://github.com/brawer/fonttest/blob/master/src/fonttest/freestack_font.cpp#L59
You have forgotten to multiply `fixedSize' by 64 to convert to 26.6 format – I assume that you don't have overloaded the `static_cast<FT_Fixed>' operator to do that automatically, right? (Admittedly, I don't know whether this is possible at all.)
https://github.com/brawer/fonttest/blob/master/src/fonttest/freestack_font.cpp#L95
You are loading the font at 1000ppem, which is arbitrary. In particular, since you don't use FT_LOAD_NO_SCALE in line 97, glyph component positions get rounded which might lead to incorrect values even at that size.
Either use the UPEM value as the charsize (then rounding to full pixels doesn't do any harm since you are essentially operating in font units), or add the FT_LOAD_NO_SCALE flag to directly get all values in font units.
|
Wed 21 Sep 2016 07:49:29 AM UTC, comment #3:
Thanks for the analysis. Here’s my call to FT_New_Face():
https://github.com/brawer/fonttest/blob/master/src/fonttest/freestack_engine.cpp#L41
Here’s the call to FT_Set_Char_Size():
https://github.com/brawer/fonttest/blob/master/src/fonttest/freestack_font.cpp#L59
Here’s the call to FT_Load_Glyph():
https://github.com/brawer/fonttest/blob/master/src/fonttest/freestack_font.cpp#L97
Here’s the call to FT_Outline_Decompose():
https://github.com/brawer/fonttest/blob/master/src/fonttest/freestack_path.cpp#L49
Did I fail to set any other flags that should be set? (By the way, I’ll soon move the codebase out of my private repo to some place owned by unicode.org, so the above links will change).
|
Wed 21 Sep 2016 07:20:18 AM UTC, comment #2:
The value `ROUND_XY_TO_GRID' is indeed set for this glyph component. So the question is how the conformance test gets called.
I've just checked the source: FreeType only rounds to pixels if `FT_LOAD_NO_SCALE' is not set. Maybe you load the glyph at PPEM size without this flag, and you have forgotten to use 26.6 format for the width and height arguments in the call to `FT_Set_Char_Size'?
|
Tue 20 Sep 2016 08:54:18 PM UTC, comment #1:
What is the the value of ROUND_XY_TO_GRID flag for this component?
If it is TRUE, then (262,0) gets rounded to (256,0), then the first point is placed at (262,671), like you said.
|
Tue 20 Sep 2016 03:39:55 PM UTC, original submission:
FreeType sometimes mis-positions components of composite glyphs.
With the attached test font, FreeType places the accent on top of `gcommaabove` ģ too far to the left; the placement is off by six font design units. In the font’s `glyf` table, gcommaabove has two components: 1. g at (0,0), and 2. commaturnedabovecomb at (262,0). The path for commaturnedabovecomb starts with an on-curve point at (6,671). Therefore, when FreeType is asked for an outline of the composite glyph `gcommaabove`, the accent’s first point should be at (268,671). Instead, it’s at (262,671). It smells interesting that the mis-placement is by the same amount as the accent’s first point’s x coordinate.
https://raw.githack.com/brawer/fonttest/master/reports/FreeStack.html#GLYF-1
Apple’s CoreText renders the glyph as expected. Compared to FreeType, the accent is six units further to the right, that is at the expected position.
https://raw.githack.com/brawer/fonttest/master/reports/CoreText.html#GLYF-1
|
(Note: upload size limit is set to 16384 kB, after insertion of the required
escape characters.)
Attach File(s):
Comment:
Depends on the following items: None found
Items that depend on this one: None found
Follow 5 latest changes.