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.
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?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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?
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.
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).
Thanks!