baruchel / txt2pdf

Text to PDF converter with Unicode support

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

error with $ txt2pdf -f NotoColorEmoji.ttf -o test.pdf test.txt

gnusupport opened this issue · comments

I would like to get color emoji, but there is error:

Traceback (most recent call last):
  File "/home/data1/protected/bin/txt2pdf", line 335, in <module>
    PDFCreator(args, Margins(
  File "/home/data1/protected/bin/txt2pdf", line 67, in __init__
    pdfmetrics.registerFont(TTFont('myFont', args.font))
  File "/home/data1/protected/.local/lib/python3.10/site-packages/reportlab/pdfbase/ttfonts.py", line 1177, in __init__
    self.face = TTFontFace(filename, validate=validate, subfontIndex=subfontIndex)
  File "/home/data1/protected/.local/lib/python3.10/site-packages/reportlab/pdfbase/ttfonts.py", line 1071, in __init__
    TTFontFile.__init__(self, filename, validate=validate, subfontIndex=subfontIndex)
  File "/home/data1/protected/.local/lib/python3.10/site-packages/reportlab/pdfbase/ttfonts.py", line 439, in __init__
    self.extractInfo(charInfo)
  File "/home/data1/protected/.local/lib/python3.10/site-packages/reportlab/pdfbase/ttfonts.py", line 853, in extractInfo
    if 'loca' not in self.table: raise TTFError('missing location table')
reportlab.pdfbase.ttfonts.TTFError: missing location table

Do you have an example (along with font location) that shows the problem? My guess is that it's specific to the NotoColorEmoji.TTF font being used. You could try loading it into a tool like FontForge and re-saving it - but that's an educated guess on my part.

for:

txt2pdf -f NotoColorEmoji.ttf -o test.pdf test.txt

need test.txt as attachment and location (or attachment of NotoColorEmoji.ttf)