This repository was archived by the owner on Aug 31, 2021. It is now read-only.
[[ 14436 ]] Ensure valid custom fonts can be loaded on Android#7415
Open
livecodepanos wants to merge 1 commit intolivecode:develop-9.6from
Open
[[ 14436 ]] Ensure valid custom fonts can be loaded on Android#7415livecodepanos wants to merge 1 commit intolivecode:develop-9.6from
livecodepanos wants to merge 1 commit intolivecode:develop-9.6from
Conversation
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.
runrevmark
reviewed
Aug 25, 2020
| // 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) |
Contributor
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_idandlanguage_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: