googlefonts / googlefonts.github.io

Google Fonts documentation
https://googlefonts.github.io
Apache License 2.0
57 stars 27 forks source link

CJK vertical metrics suggestion #45

Open NightFurySL2001 opened 2 years ago

NightFurySL2001 commented 2 years ago

According to https://googlefonts.github.io/gf-guide/metrics.html#cjk-vertical-metrics, it is suggested that the OS/2.sTypoAscender is set to 0.88 font UPM and the OS/2.sTypoDescender is set to -0.12 font UPM. The table is attached below:

Attrib Value Example using 1000upm font
OS/2.sTypoAscender 0.88 * font upm 880
OS/2.sTypoDescender -0.12 * font upm -120
OS/2.sTypoLineGap 0 0
hhea.ascender Set to look comfortable (\~1.16 * upm) 1160
hhea.descender Set to look comfortable (\~0.288 * upm) -288
hhea.lineGap 0 0
OS/2.usWinAscent Same as hhea.ascent 1160
OS/2.usWinDescent abs(value) of hhea.descent 288
OS/2.fsSelection bit 7 (Use_Typo_Metrics) Do not set / disabled 0

Our decision to follow the Adobe schema was based on Dr. Ken Lunde’s comments and his release notes on Source Han Sans:

However, these metrics are only used in Japanese fonts. In Korean font (such as IBM Plex KR developed by Sandoll Inc), the ratio used is 0.8:0.2, which some Chinese font foundries use too. Another typical Chinese font foundry used is 0.85:0.15, as this allows more descender space compared to 0.88:0.12. There are some other combination of values which is used for individual creators too.

The referenced issue provided to justify these values (https://github.com/source-foundry/font-line/issues/2) only explicitly mention this (quoted from @kenlunde):

To add to the discussion with regard to the sTypoAscender and sTypoDescender values in the 'OS/2' table, while I cannot speak with any authority to non-CJK fonts, at least for CJK fonts I feel somewhat strongly that these values 1) add up to equal the UPM and 2) correspond to the top and bottom of the ideographic em-box in which CJK glyphs are optically centered. For the other vertical metrics values, I see little or no disagreement.

Thus, I would like to suggest the guide to change the guidelines to allow any ratio for the OS/2 sTypo values as long as:

RosaWagner commented 2 years ago

That is good info, thanks.

@davelab6 @chrissimpkins should we update the vertical metric policy for CJK fonts accordingly?

cc @vv-monsalve @m4rc1e @aaronbell

NightFurySL2001 commented 2 years ago

This would also fix the issue of IBM Plex KR is different from its source file as the original KR font uses 780/-220. (Issue reference)

yisibl commented 1 year ago

Why is it recommended to disable Use_Typo_Metrics here?

NightFurySL2001 commented 1 year ago

OS/2.sTypoAscender and OS/2.sTypoDescender are used for CJK bounding box. Setting Use_Typo_Metrics will make the font look shorter (usually). Source quote:

Else If this is a CJK font:

ideoEmboxBottom = OS/2.sTypoDescender
ideoEmboxTop = OS/2.sTypoAscender
ideoEmboxRight = head.unitsPerEm
NightFurySL2001 commented 1 year ago

Any updates on changing the guidelines?

vv-monsalve commented 3 months ago

@aaronbell, this proposal requires CJK's expertise, could you please help us to review it?

aaronbell commented 3 months ago

The suggestion seems reasonable to me. Ken's method of 880 / -120 works well for standard CJK use, but I can see other ratios being employed depending on the requirements of the specific project. As long as the CJK bounding box aligns with the UPM, things should be alright.