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
base: dslib-stat-instances-clarify
Are you sure you want to change the base?
Conversation
Hm, wait, this still leaves the 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"> |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
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.