You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The glyph outlines in an OpenType font may be defined in two formats, TrueType or Compact Font Format (CFF), the latter is not supported by this tool, there are two major reasons:
Render engines ignore OpenType hmtx table (Horizontal Metrics Table, which specified glyph width and side bearing) for CFF outlines font, because CFF data also contains relevant values and takes higher priority.
It can be fixed through changing the defaultWidthX values inside CFF data and hardcoding side bearing into glyphs.
CFF2 format does not have this problem as it only contains glyph data.
Render engines cannot be tuned to "monospace mode" with CFF outlines font in any way, OS/2.panose.bProportion is ignored, post.isFixedPitch has no effect, even hdmx feature won't help.
"monospace mode" is needed to align CJK characters with Latin characters correctly, for example, if a monospaced font is 0.6:1 ratio and displayed at 14px, render engine will render it at width 14*0.6=8.4 round to 8px, and render the aligned CJK characters at width 14*1.2=16.8 round to 17px, alignment will be broken without additional adjustment.
Some render engines always enable this adjustment but others are not, they only enable it for fonts with matched property.
Furthermore, I could not find any CFF outlines font aligned correctly under every environment, for a test case, neither Source Han Mono nor Source Han Code JP aligned correctly in WebStorm 2022.2.1(#WS-222.3739.57) under Windows 10 21H2(19044.1889).
PS: If you are trying to fallback to Source Han Sans, there are several third-party TrueType outlines editions such as Source-Han-TrueType and source-han-sans-ttf.
The text was updated successfully, but these errors were encountered:
The glyph outlines in an OpenType font may be defined in two formats, TrueType or Compact Font Format (CFF), the latter is not supported by this tool, there are two major reasons:
hmtx
table (Horizontal Metrics Table, which specified glyph width and side bearing) for CFF outlines font, because CFF data also contains relevant values and takes higher priority.defaultWidthX
values inside CFF data and hardcoding side bearing into glyphs.OS/2.panose.bProportion
is ignored,post.isFixedPitch
has no effect, evenhdmx
feature won't help.Furthermore, I could not find any CFF outlines font aligned correctly under every environment, for a test case, neither Source Han Mono nor Source Han Code JP aligned correctly in WebStorm 2022.2.1(#WS-222.3739.57) under Windows 10 21H2(19044.1889).
PS: If you are trying to fallback to Source Han Sans, there are several third-party TrueType outlines editions such as Source-Han-TrueType and source-han-sans-ttf.
The text was updated successfully, but these errors were encountered: