Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FontnameParser: Fix fsSelection for --has-no-italic #1255

Merged
merged 1 commit into from
May 22, 2023

Conversation

Finii
Copy link
Collaborator

@Finii Finii commented May 22, 2023

[why]
For fonts that have no Italic but an Oblique - i.e. when Oblique shall replace the Italic role in RIBBI font grouping (classic group of 4) - that grouping fails.

This affects DejaVu on Putty.

[how]
For RIBBI grouping only the classic bits are considered. That means that for fonts that have Oblique instead of Italic (and not additionally) we need to set the ITALIC bit and the OBLIQUE bit. This has been overlooked.

Cite from the specs:

This bit, unlike the ITALIC bit (bit 0), is not related to style-linking
in applications that assume a four-member font-family model comprised
of regular, italic, bold and bold italic. It may be set or unset
independently of the ITALIC bit. In most cases, if OBLIQUE is set, then
ITALIC will also be set, though this is not required.

Fixes: #1249

Reported-by: Huifeng Shen [email protected]

Requirements / Checklist

What does this Pull Request (PR) do?

How should this be manually tested?

Create new set of DejaVu, install NFM on Windows, start putty.

Any background context you can provide?

https://learn.microsoft.com/en-us/typography/opentype/spec/os2#fsselection

What are the relevant tickets (if any)?

Screenshots (if appropriate or helpful)

@Finii Finii added the Bug fix label May 22, 2023
@Finii Finii added this to the v3.0.2 milestone May 22, 2023
@Finii
Copy link
Collaborator Author

Finii commented May 22, 2023

Fixed:

image

Thanks again @liaoya for reporting!

@Finii
Copy link
Collaborator Author

Finii commented May 22, 2023

Affected:

$ grep -r --include '*.cfg' '.--has-no' .
./src/unpatched-fonts/DejaVuSansMono/config.cfg:config_patch_flags="--has-no-italic"
./src/unpatched-fonts/BitstreamVeraSansMono/config.cfg:config_patch_flags="--has-no-italic"

[why]
For fonts that have no Italic but an Oblique - i.e. when Oblique shall
replace the Italic role in RIBBI font grouping (classic group of 4) -
that grouping fails.

This affects DejaVu on Putty.

[how]
For RIBBI grouping only the classic bits are considered. That means that
for fonts that have Oblique instead of Italic (and not additionally) we
need to set the ITALIC bit and the OBLIQUE bit. This has been
overlooked.

Cite from the specs:

> This bit, unlike the ITALIC bit (bit 0), is not related to style-linking
> in applications that assume a four-member font-family model comprised
> of regular, italic, bold and bold italic. It may be set or unset
> independently of the ITALIC bit. In most cases, if OBLIQUE is set, then
> ITALIC will also be set, though this is not required.

[note]
Also increase font-patcher version.

Fixes: #1249

Reported-by: Huifeng Shen <[email protected]>
Signed-off-by: Fini Jastrow <[email protected]>
@Finii Finii force-pushed the bugfix/oblique-only branch from 73a10c3 to 6ce70f6 Compare May 22, 2023 11:25
@Finii Finii merged commit 438843d into master May 22, 2023
@Finii Finii deleted the bugfix/oblique-only branch May 22, 2023 11:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DejaVu has no Regular with Putty
1 participant