Menu

#3 Fix broken handling of font names

v1.0 (example)
closed-fixed
nobody
None
5
2016-01-31
2016-01-22
No

The code was wrongly using the index of name entries in the name table as name id, which makes no sense at all and just happened to work by sheer luck.

1 Attachments

Discussion

  • Eugeniy Meshcheryakov

    Thanks for your report. I agree that current font name handling is a bug. I have some concerns about your patch requiring those platform and encodings IDs. Are there any fonts that have names with other encogins/platforms only?

     
  • Khaled Hosny

    Khaled Hosny - 2016-01-31

    I don’t think a font will work on Windows without the MS platform names, and it will pretty much always UCS-2 encoding, so we can assume any font will have those (unless it is some ancient Mac font). We can try to support other encodings/platforms, but I think it is rare enough to be worth the complication, and the fallback code should be good enough even then.

     
  • Eugeniy Meshcheryakov

    • status: open --> closed-fixed
     
  • Eugeniy Meshcheryakov

    I've commited your patch. Additionally I extended buffer for UTF-8 decoding and fixed off-by-one error in buffer size (your patch passes entire length of the buffer to iconv and then adds NUL symbol at the end).

     
  • Khaled Hosny

    Khaled Hosny - 2016-01-31

    Thanks!

     

Log in to post a comment.