Skip to content

Superscript 4 gives KeyError: '⁴' in pdfme\fonts.py #36

@maxschmittkenfo

Description

@maxschmittkenfo

Hey!

When I want to print superscript 4 (and above) I get:

\venv\Lib\site-packages\pdfme\fonts.py", line 134, in <genexpr>
    return sum(self.widths[char] for char in text) / 1000
               ~~~~~~~~~~~^^^^^^
KeyError: '⁴'

when I add '⁴' to the widths-dict, I get:

UnicodeEncodeError: 'latin-1' codec can't encode character '\u2074' in position 63: ordinal not in range(256)

Superscript 1,2,3 seem to be in 'latin'-encoding, but all others not. How can I print them in a PDF with pdfme?

Kind regards, Max

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions