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

[designspaceLib] Provide fallback for elidedFallbackName #2903

Open
wants to merge 1 commit into
base: dslib-stat-instances-clarify
Choose a base branch
from

Conversation

madig
Copy link
Contributor

@madig madig commented Nov 22, 2022

Provide a fallback for the DS-wide elidedFallbackName.

This is a bit unfortunate, because the DesignSpaceDocument.elidedFallbackName is a string, not a localization dict. However, if it is not set by the user, we just insert a generic English "Regular". Still better than having an empty style name.

This also fixes a bug where a RIBBI style would end up with a style mapping like stylemapfamilyname="Source Serif 4 Bold Italic" stylemapstylename="regular". RIBBI styles should not be part of the style map family name.

Closes #2877.

@madig
Copy link
Contributor Author

madig commented Nov 22, 2022

Hm, wait, this still leaves the fvar name for the fully elided location empty.

Edit: huh... it works on Windows but not Linux?!

@@ -196,7 +196,7 @@
<kerning/>
<info/>
</instance>
<instance name="Source Serif 4 Bold Italic" familyname="Source Serif 4" stylename="Bold Italic" filename="Source Serif 4-Bold Italic.ttf" postscriptfontname="SourceSerif4Italic-Bold" stylemapfamilyname="Source Serif 4 Bold Italic" stylemapstylename="regular">
<instance name="Source Serif 4 Bold Italic" familyname="Source Serif 4" stylename="Bold Italic" filename="Source Serif 4-Bold Italic.ttf" postscriptfontname="SourceSerif4Italic-Bold" stylemapfamilyname="Source Serif 4" stylemapstylename="regular">
Copy link
Contributor

Choose a reason for hiding this comment

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

This change sounds wrong, either keep the stylemapfamilyname, or change the stylemapstylename to bold italic?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The DS has no style linking though? How is getStatName supposed to do the right thing?

Copy link
Contributor

Choose a reason for hiding this comment

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

No style linking = stylemapfamilyname is set to the familyname + stylename, and stylemapstylename is set to regular

Copy link
Contributor

Choose a reason for hiding this comment

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

Otherwise, applications that don't understand the 16/17 named ids are going to see a bunch of "Source Serif 4" fonts and won't be able to distinguish them, that's why we put the stylename into the stylemapfamilyname.

The other option, if the DS had style linking, would be to set the stylemapstylename correctly, in this case bold italic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants