Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
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
wants to merge 1 commit into
base: develop-9.6
Choose a base branch
Loading
from

Conversation

livecodepanos
Copy link
Contributor

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:

before

After:

after

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.
@livecodepanos livecodepanos added this to the 9.6.2-rc-1 milestone Aug 13, 2020
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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@livecodepanos livecodepanos modified the milestones: 9.6.2-rc-1, 9.6.3-rc-1 Nov 24, 2020
@runrevmark runrevmark added the WIP label Jun 30, 2021
@runrevmark runrevmark removed this from the 9.6.3-rc-1 milestone Jun 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.