question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

merge_fonts.py KeyError: 'cid00001#1'

See original GitHub issue

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'

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:5
  • Comments:7

github_iconTop GitHub Comments

2reactions
rspilkercommented, 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  ",
0reactions
ghostcommented, 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: https://github.com/fonttools/fonttools/issues/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).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Python KeyError Exceptions and How to Handle Them
In this tutorial, you'll learn how to handle Python KeyError exceptions. They are often caused by a bad key lookup in a dictionary,...
Read more >
How to Fix KeyError Exceptions in Python - Rollbar
The Python KeyError is an exception that occurs when an attempt is made to access an item in a dictionary that does not...
Read more >
Key error when performing pd.merge on string columns
I'm having trouble performing a merge on two dataframes. My data is as follows, one comprises a dataset of 140,000 occurrence records of...
Read more >
How to fix Python KeyError Exceptions in simple steps?
Know about Python KeyError Exception. And learn how to handle exceptions in Python. A detailed guide to Errors and Exceptions in Python.
Read more >
keyerror in Python – How to Fix Dictionary Error
When working with dictionaries in Python, a KeyError gets raised when you try to access an item that doesn't exist in a Python...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found