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

merge_fonts.py KeyError: 'cid00001#1' #511

Open
benbro opened this issue Feb 26, 2020 · 7 comments
Open

merge_fonts.py KeyError: 'cid00001#1' #511

benbro opened this issue Feb 26, 2020 · 7 comments

Comments

@benbro
Copy link

benbro commented Feb 26, 2020

I've installed master with pip and downloaded all fonts from https://www.google.com/get/noto/
When trying to merge with:

python merge_fonts.py -d individual/unhinted -o NotoSansMerged-Regular.ttf

I first got an error:
KeyError: 'AnatolianHieroglyphs'
I've commented the line "'NotoSansAnatolianHieroglyphs-Regular.ttf'," in merge_fonts.py and tried again and got another error:
KeyError: 'cid00001#1'

@SamJarmanPP
Copy link

I saw KeyError: 'cid00001#15' after takign the same step to prevent the first error

@rspilker
Copy link

rspilker commented Jun 19, 2020

To fix the "AnatolianHieroglyphs" error, a new line 95 should be inserted in merge_noto.py:

    "AnatolianHieroglyphs":"hluw",

So the section would become:

    "OlChiki": "olck",
    "TaiLe": "tale",
    # Following keys are added to satisfy the use case in merge_fonts.py
    # Reference:
    # https://www.google.com/get/noto/#sans-xsux
    # https://www.google.com/get/noto/#sans-cprt
    # https://www.google.com/get/noto/#sans-yiii
    # https://www.microsoft.com/typography/otspec/scripttags.htm
    "AnatolianHieroglyphs":"hluw",
    "Cuneiform": "xsux",
    "Cypriot": "cprt",
    "Yi": "yi  ",

@koumaza
Copy link

koumaza commented Jul 11, 2020

Is there no choice but to ignore the error now?

@sp96296
Copy link

sp96296 commented Aug 14, 2020

Im getting the same error while trying to merge the CJK fonts with the Regular set.

@sp96296
Copy link

sp96296 commented Aug 14, 2020

Im getting the same error while trying to merge the CJK fonts with the Regular set.

"file" section of merge_fonts.py

files = [  
    # It's recommended to put NotoSans-Regular.ttf as the first element in the  
    # list to maximize the amount of meta data retained in the final merged font.  
    "NotoSerif-Regular.ttf",  
    "NotoSerifCJKjp-Regular.otf",  
    "NotoSerifCJKkr-Regular.otf",  
    "NotoSerifCJKsc-Regular.otf",  
    "NotoSerifCJKtc-Regular.otf",  
    "NotoSerifDisplay-Regular.ttf",  
]  

EDIT:
I tried adding "CJK Ideographic" : "hani", "Hiragana" : "kana", and "Hangul" : "hang" to the SCRIPT_TO_OPENTYPE_SCRIPT_TAG function of merge_noto.py, but no luck.

@koumaza
Copy link

koumaza commented Aug 14, 2020

This script only merges fonts,
https://github.com/koumaza/Ecchi-fFont/blob/39a47d47ea578abade8b6d8b41203fddf5e8dbef/tool/merge.pe

Does merge_fonts.py here just do the merge? Or is there another function?

@ghost
Copy link

ghost commented Aug 16, 2020

In addition to the easy to fix "AnatolianHieroglyphs" problem (thanks @rspilker ), there seem to be other issues making the script merge_fonts.py not working out of the box:

  • some fonts are otf
  • some fonts have a different UPM

The resulting errors of a dependency seem to be similar to these: fonttools/fonttools#1309
I tried merging with a CJK ttf file I downloaded online, but apparently this exceeds some kind of number range:
struct.error: 'H' format requires 0 <= number <= 65535
For now, I managed to merge 37 fonts (without CJK).

Noto is a great project, but we really need a single font file (for example when generating a pdf with unknown input language).

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

6 participants
@benbro @rspilker @sp96296 @koumaza @SamJarmanPP and others