-
Notifications
You must be signed in to change notification settings - Fork 608
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
horizontal font extent disagreements between ft/ot funcs for mongolian/phags pa. #1262
Comments
Supposedly both get the values from hhea. I decompiled the hhea table from the first font, and the ot values are there. So somehow the ft version is returns values not from hhea. |
It appeared the FT values has been moved down or up to the next multiple of 64 |
Yeah this is a known issue. I thought we didn't hinting and that should do it. Are you testing with recent FreeType? |
I am using ft 2.9.1 (the current latest release). Were you asking if I am testing against freetype git head? I am staying off freetype git head until GSoC wrapped up and settling, I think. |
Check the OS/2 table, it is possible that FreeType or HarfBuzz is reading the values from it rather than from hhea. Last I checked, FreeType had some heuristics to decide which table and which set of values to use, not sure of OT functions use the same heuristics or any at all. |
I looked at the FreeType side - it is supposedly hhea then OS/2. The values look like they were clipped to one direction to multiple of 64, so I am inclined to think Behdad is right in saying it is probably some sort of hinting, or "fit to grid" issue somewhere. |
hb-view uses cairo's numbers, which are proper numbers, not hacked-up use of FreeType. |
Yeah, I'm certain that's what's happening. Never figured out why even though we turn all hinting off. Maybe FreeType always rounds font extents? |
The two sets of font extent functions also do wildly different things for ukai from freedesktop.org . |
Care to paste numbers? And link to font?! |
The links to font are available here: |
See freetype/src/base/ftobjs.c:ft_recompute_scaled_metrics() and the usage of GRID_FIT_METRICS inside. Fixes harfbuzz#1262
Since the issue obviously caused confusion it's probably necessary to improve FreeType's documentation. Any patches are highly welcomed! |
The issue is just that harfbuzz does not consider entities as F26.6's. It sets FT_Char_Size to (F26.6) upem and hopes mistakenly that everything is then in upem. Some FT values are rounded to whole pixels in F26.6. Back in 2006 somebody wanted those numbers in fractional pixels. Pango broke, and it was reverted back to rounding to whole pixels. I suppose FT documentation could emphasize that some numbers are in whole pixels in F26.6 ... I'll think about where that can go. |
The FT documentation did say they are rounded. Also
I'd say just pull #1363 and be done. |
* Use non-GRID-fitted values for metrics See freetype/src/base/ftobjs.c:ft_recompute_scaled_metrics() and the usage of GRID_FIT_METRICS inside. Fixes #1262 * Update hb-ft.cc
* Use non-GRID-fitted values for metrics See freetype/src/base/ftobjs.c:ft_recompute_scaled_metrics() and the usage of GRID_FIT_METRICS inside. Fixes harfbuzz#1262 * Update hb-ft.cc
The font extents reported by the ft/ot versions don't agree:
ft:
ot:
ft:
ot:
In both of these cases, hb-view seems to be using the
ot
numbers, although I cannot seem to find out where it switches. At line 690 ofutil/options.cc
, it defaults to the first entry, which isft
if harfbuzz can find freetype.The text was updated successfully, but these errors were encountered: