Fix the REGULAR bit of the fsSelection being set incorrectly #1222
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.
Description
This commit resolves the issue of the fsSelection of the OS/2 table not being properly set.
According to Microsoft's documentation, bit 6 (REGULAR) of fsSelection is recommended to be set only when bit 0 (ITALIC) and bit 5 (BOLD) are clear.
However, the current script sets bit 6 (REGULAR) without following this rule (for example, when the font name is
XXX-BoldItalic.ttf
).So, I have made changes to ensure that bit 6 (REGULAR) is not set when bit 0 (ITALIC), bit 5 (BOLD), or bit 9 (OBLIQUE) is set.
While the documentation does not specify whether bit 6 (REGULAR) should be cleared when bit 9 (OBLIQUE) is set, I think it should be treated like 0 (ITALIC) and bit 5 (BOLD).
Requirements / Checklist
What does this Pull Request (PR) do?
How should this be manually tested?
Any background context you can provide?
What are the relevant tickets (if any)?
Screenshots (if appropriate or helpful)