googlefonts/noto-emoji

type error when trying to embed a .png image into an existing font

VPraharsha03 opened this issue · 0 comments

write_glyphMetrics() throws a type error when I was trying to embed a .PNG into the seguiemj.ttf font

❯ python ~/noto-emoji/third_party/color_emoji/emoji_builder.py -V ./seguiemj.ttf ./seguiemj-patched.ttf icons/devpython

Loaded font './seguiemj.ttf'.
Font metrics: upem=2048 ascent=1491 descent=431.

Looking for images matching 'icons/devpython*.png'.
Found images for 1 characters in 'icons/devpython*.png'.
Embedding images for 1 glyphs for this strike.
Strike ppem set to 93.
Traceback (most recent call last):
  File "~/noto-emoji/third_party/color_emoji/emoji_builder.py", line 144, in write_glyphMetrics
    self.write (struct.pack ("BBbbBbbB",
struct.error: required argument is not an integer

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "~/noto-emoji/third_party/color_emoji/emoji_builder.py", line 576, in <module>
    main (sys.argv)
  File "~/noto-emoji/third_party/color_emoji/emoji_builder.py", line 546, in main
    ebdt.write_glyphs (glyphs, glyph_imgs, image_format)
  File "~/noto-emoji/third_party/color_emoji/emoji_builder.py", line 98, in write_glyphs
    write_func (PNG (img_file))
  File "~/noto-emoji/third_party/color_emoji/emoji_builder.py", line 194, in write_format18
    self.write_format17or18(png, True)
  File "~/noto-emoji/third_party/color_emoji/emoji_builder.py", line 202, in write_format17or18
    self.write_glyphMetrics (width, height, big_metrics)
  File "~/noto-emoji/third_party/color_emoji/emoji_builder.py", line 156, in write_glyphMetrics
    raise ValueError("%s, h: %d w: %d x: %d y: %d %d a:" % (
ValueError: required argument is not an integer, h: 128 w: 128 x: 0 y: 88 128 a:

What is the reason for this error ? Is there anything that can be done to make sure that the type passed to it is an int ?