Skip to content

locl not working in Chrome/Firefox when showing individual punctuation #439

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

Open
NightFurySL2001 opened this issue Jul 16, 2023 · 1 comment

Comments

@NightFurySL2001
Copy link

NightFurySL2001 commented Jul 16, 2023

When using OpenType locl feature to show individual CJK punctuations, in Chrome and Firefox some do not load the correct punctuation. See the left 2nd-6th column.

It is suspected that there is no script DFLT in feature file (only language dflt), while the punctuations are sc=Zyyy, so when Chrome calculate they become default (no preceding sc) and no script match them in feature.

Chrome: (Does not load any of them)
image

Firefox: (Does not load U+3001 、 and U+3002 。 for TW/HK)
image

It is fine in Microsoft Word and Adobe InDesign.

Word:
image

InDesign:
image

Test file: test.txt

@NightFurySL2001
Copy link
Author

NightFurySL2001 commented Jul 20, 2023

After testing, it is determined that missing the script DFLT in feature file is the main source of the bug above. Below shows a rebuilt Source Han Sans (JP) font which included a script DFLT with features copied from script latn, and does not exhibit the issue anymore.

Rebuilt font: SourceHanSans-Regular.zip
Feature file: features.OTC.J.txt
Important section:

......
feature locl {
  # DFLT SCRIPT
  script DFLT;

  language dflt;
  lookup latin_special;

  language JAN exclude_dflt;
  lookup jpcntwhk_special;

  language KOR exclude_dflt;
  lookup jp2kr;
  lookup kr_special;

  language ZHS exclude_dflt;
  lookup jp2cn;
  lookup jpcntwhk_special;

  language ZHT exclude_dflt;
  lookup jp2tw;
  lookup jpcntwhk_special;

  language ZHH exclude_dflt;
  lookup jp2hk;
  lookup jpcntwhk_special;

  # LATN SCRIPT
  script latn;
......

Chrome
image

Firefox
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant