Skip to content
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

Prepare subset of noto (CJK and regular) based on another font #515

Open
jm4R opened this issue May 18, 2020 · 0 comments
Open

Prepare subset of noto (CJK and regular) based on another font #515

jm4R opened this issue May 18, 2020 · 0 comments

Comments

@jm4R
Copy link

jm4R commented May 18, 2020

I have a font (source_font), which contains regular characters and also glyphs from CJK characters. I wanted to change this font to noto. I've tried to modify some scripts to make it possible. What I've done was:

  1. Subset regular noto based on source_font coverage -> subset_not_cjk.ttf
  2. Converted CJK from OTF to TTF -> converted_cjk.ttf
  3. Subset CJK based on source_font coverage -> subset_cjk.ttf
    So far it went OK. But when I've tried to merge subset_not_cjk.ttf with subset_cjk.ttf, different warnings and errors was shown:
WARNING:fontTools.merge:Dropped cmap subtable from font [1]:    format 14, platformID  0, platEncID  5
(...)
WARNING:fontTools.merge:Dropped mapping from codepoint 0XF904 to glyphId 'uniF904'
WARNING:fontTools.merge:Dropped mapping from codepoint 0XF908 to glyphId 'uniF908'
(... and many simillar warnings here ...)
Traceback (most recent call last):
  File "/some/path/noto_based_on.py", line 305, in <module>
    main()
  File "/some/path/noto_based_on.py", line 271, in main
    font = merger.merge(valid_files)
  File "/home/someuser/.local/lib/python3.6/site-packages/fontTools/merge.py", line 996, in merge
    table = clazz(tag).merge(self, tables)
  File "/home/someuser/.local/lib/python3.6/site-packages/fontTools/merge.py", line 159, in merge
    return m.mergeObjects(self, self.mergeMap, tables)
  File "/home/someuser/.local/lib/python3.6/site-packages/fontTools/merge.py", line 1044, in mergeObjects
    value = mergeLogic(getattr(table, key, NotImplemented) for table in tables)
  File "/home/someuser/.local/lib/python3.6/site-packages/fontTools/merge.py", line 48, in equal
    assert all(item == first for item in t), "Expected all items to be equal: %s" % lst
AssertionError: Expected all items to be equal: [NotImplemented, 'vhea']

The question is: Is this operation technically possible (assoming glyphs count doesn't exceed 2^16)? If so, why the process shows such warnings/errors?

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