Skip to content

Commit

Permalink
update usWidthClass and openTypeOS2WidthClass properties only for…
Browse files Browse the repository at this point in the history
… Condensed fonts

Fix: #130
Related: typst/typst#2098
  • Loading branch information
drupol committed Dec 27, 2024
1 parent b698348 commit d6893e7
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 17 deletions.
4 changes: 2 additions & 2 deletions scripts/instantiate_condensed.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@


roman_instance = {
"attribs": {"usWidthClass": 5},
"attribs": {"usWidthClass": 3},
"axes": {"wdth": 75},
"filename": "RobotoCondensed[wght].ttf",
"names": {
Expand All @@ -25,7 +25,7 @@
}

italic_instance = {
"attribs": {"usWidthClass": 5, "italicAngle": -12, "caretSlopeRise": 2048, "caretSlopeRun": 435},
"attribs": {"usWidthClass": 3, "italicAngle": -12, "caretSlopeRise": 2048, "caretSlopeRun": 435},
"axes": {"wdth": 75},
"filename": "RobotoCondensed-Italic[wght].ttf",
"names": {
Expand Down
17 changes: 8 additions & 9 deletions scripts/instantiate_statics.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
},
},
{
"attribs": {"fsSelection": 64, "macStyle": 0, "usWeightClass": 300, "usWidthClass": 5},
"attribs": {"fsSelection": 64, "macStyle": 0, "usWeightClass": 300, "usWidthClass": 3},
"axes": {"ital": 0.0, "wdth": 75.0, "wght": 300},
"filename": "RobotoCondensed-Light.ttf",
"names": {
Expand All @@ -68,7 +68,7 @@
},
},
{
"attribs": {"fsSelection": 513, "macStyle": 2, "usWeightClass": 300, "italicAngle": -12, "usWidthClass": 5, "caretSlopeRise": 2048, "caretSlopeRun": 435},
"attribs": {"fsSelection": 513, "macStyle": 2, "usWeightClass": 300, "italicAngle": -12, "usWidthClass": 3, "caretSlopeRise": 2048, "caretSlopeRun": 435},
"axes": {"ital": 1.0, "wdth": 75.0, "wght": 300},
"filename": "RobotoCondensed-LightItalic.ttf",
"names": {
Expand Down Expand Up @@ -108,7 +108,7 @@
},
},
{
"attribs": {"fsSelection": 64, "macStyle": 0, "usWeightClass": 400, "usWidthClass": 5},
"attribs": {"fsSelection": 64, "macStyle": 0, "usWeightClass": 400, "usWidthClass": 3},
"axes": {"ital": 0.0, "wdth": 75.0, "wght": 400},
"filename": "RobotoCondensed-Regular.ttf",
"names": {
Expand All @@ -120,7 +120,7 @@
},
},
{
"attribs": {"fsSelection": 513, "macStyle": 2, "usWeightClass": 400, "italicAngle": -12, "usWidthClass": 5, "caretSlopeRise": 2048, "caretSlopeRun": 435},
"attribs": {"fsSelection": 513, "macStyle": 2, "usWeightClass": 400, "italicAngle": -12, "usWidthClass": 3, "caretSlopeRise": 2048, "caretSlopeRun": 435},
"axes": {"ital": 1.0, "wdth": 75.0, "wght": 400},
"filename": "RobotoCondensed-Italic.ttf",
"names": {
Expand All @@ -144,7 +144,7 @@
},
},
{
"attribs": {"fsSelection": 64, "macStyle": 0, "usWeightClass": 500, "usWidthClass": 5},
"attribs": {"fsSelection": 64, "macStyle": 0, "usWeightClass": 500, "usWidthClass": 3},
"axes": {"ital": 0.0, "wdth": 75.0, "wght": 500},
"filename": "RobotoCondensed-Medium.ttf",
"names": {
Expand Down Expand Up @@ -172,7 +172,7 @@
},
},
{
"attribs": {"fsSelection": 513, "macStyle": 2, "usWeightClass": 500, "italicAngle": -12, "usWidthClass": 5, "caretSlopeRise": 2048, "caretSlopeRun": 435},
"attribs": {"fsSelection": 513, "macStyle": 2, "usWeightClass": 500, "italicAngle": -12, "usWidthClass": 3, "caretSlopeRise": 2048, "caretSlopeRun": 435},
"axes": {"ital": 1.0, "wdth": 75.0, "wght": 500},
"filename": "RobotoCondensed-MediumItalic.ttf",
"names": {
Expand Down Expand Up @@ -200,7 +200,7 @@
},
},
{
"attribs": {"fsSelection": 32, "macStyle": 1, "usWeightClass": 700, "usWidthClass": 5},
"attribs": {"fsSelection": 32, "macStyle": 1, "usWeightClass": 700, "usWidthClass": 3},
"axes": {"ital": 0.0, "wdth": 75.0, "wght": 700},
"filename": "RobotoCondensed-Bold.ttf",
"names": {
Expand All @@ -224,7 +224,7 @@
},
},
{
"attribs": {"fsSelection": 545, "macStyle": 3, "usWeightClass": 700, "italicAngle": -12, "usWidthClass": 5, "caretSlopeRise": 2048, "caretSlopeRun": 435},
"attribs": {"fsSelection": 545, "macStyle": 3, "usWeightClass": 700, "italicAngle": -12, "usWidthClass": 3, "caretSlopeRise": 2048, "caretSlopeRun": 435},
"axes": {"ital": 1.0, "wdth": 75.0, "wght": 700},
"filename": "RobotoCondensed-BoldItalic.ttf",
"names": {
Expand Down Expand Up @@ -289,4 +289,3 @@
del instance['STAT']
out_path = os.path.join(sys.argv[2], inst["filename"])
instance.save(out_path)

2 changes: 1 addition & 1 deletion sources/RobotoCondensed-Bold.ufo/fontinfo.plist
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@
<key>openTypeOS2WeightClass</key>
<integer>700</integer>
<key>openTypeOS2WidthClass</key>
<integer>5</integer>
<integer>3</integer>
<key>openTypeOS2WinAscent</key>
<integer>2146</integer>
<key>openTypeOS2WinDescent</key>
Expand Down
2 changes: 1 addition & 1 deletion sources/RobotoCondensed-BoldItalic.ufo/fontinfo.plist
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@
<key>openTypeOS2WeightClass</key>
<integer>700</integer>
<key>openTypeOS2WidthClass</key>
<integer>5</integer>
<integer>3</integer>
<key>openTypeOS2WinAscent</key>
<integer>2146</integer>
<key>openTypeOS2WinDescent</key>
Expand Down
2 changes: 1 addition & 1 deletion sources/RobotoCondensed-Italic.ufo/fontinfo.plist
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@
<key>openTypeOS2WeightClass</key>
<integer>400</integer>
<key>openTypeOS2WidthClass</key>
<integer>5</integer>
<integer>3</integer>
<key>openTypeOS2WinAscent</key>
<integer>2146</integer>
<key>openTypeOS2WinDescent</key>
Expand Down
2 changes: 1 addition & 1 deletion sources/RobotoCondensed-Light.ufo/fontinfo.plist
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@
<key>openTypeOS2WeightClass</key>
<integer>300</integer>
<key>openTypeOS2WidthClass</key>
<integer>5</integer>
<integer>3</integer>
<key>openTypeOS2WinAscent</key>
<integer>2146</integer>
<key>openTypeOS2WinDescent</key>
Expand Down
2 changes: 1 addition & 1 deletion sources/RobotoCondensed-LightItalic.ufo/fontinfo.plist
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@
<key>openTypeOS2WeightClass</key>
<integer>300</integer>
<key>openTypeOS2WidthClass</key>
<integer>5</integer>
<integer>3</integer>
<key>openTypeOS2WinAscent</key>
<integer>2146</integer>
<key>openTypeOS2WinDescent</key>
Expand Down
2 changes: 1 addition & 1 deletion sources/RobotoCondensed-Regular.ufo/fontinfo.plist
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@
<key>openTypeOS2WeightClass</key>
<integer>400</integer>
<key>openTypeOS2WidthClass</key>
<integer>5</integer>
<integer>3</integer>
<key>openTypeOS2WinAscent</key>
<integer>2146</integer>
<key>openTypeOS2WinDescent</key>
Expand Down

0 comments on commit d6893e7

Please sign in to comment.