| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
This patch makes the validity check for Android custom fonts less strict. Previously the code was allowing only fonts that had specific values for name_id, platform_id, encoding_id and language_id. This was too strict and resulted in valid fonts being rejected. The patched code only checks for name_id.
| // It appears that the platform to use here is 1 (Macintosh according to the spec). | ||
| FT_Get_Sfnt_Name(t_font_face, i, &t_sft_name); | ||
| if (t_sft_name.name_id == 4 && t_sft_name.platform_id == 1 && t_sft_name.encoding_id == 0 && t_sft_name.language_id == 0 && t_sft_name.string_len != 0) | ||
| if (t_sft_name.name_id == 4 && t_sft_name.string_len != 0) |
There was a problem hiding this comment.
Looking at the bug report I'm not sure this is correct.
There are two issues here from what I can see...
Several of the fonts listed in the bug report have their names encoded as UTF-16BE and not native - that is probably why some of those (which do have matching criteria!) do not work correctly (I also suspect they are incorrectly built fonts!).
The second is that we are not searching will less strict criteria if stricter criteria fail.
The first of these is more serious than the second as I suspect it is why several of the fonts in that bug report which do have 4100 entries are not working - and means that even if other (less strict) searches are done, it still won't work.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
This patch makes the validity check for Android custom fonts less strict. Previously the code was allowing only fonts that had specific values for name_id, platform_id, encoding_id and language_id.
This was too strict and resulted in valid fonts being rejected. The patched code only checks for name_id.
Tested on an Android 10 physical device.
Before:
After: