Skip to content

Commit

Permalink
Add 450 font weight to character width offsets
Browse files Browse the repository at this point in the history
  • Loading branch information
susiekims committed Sep 18, 2023
1 parent 5dbdd0a commit 498de25
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export const TEXT_ICON_SPACING = 4;
export const ICON_SIZE = 5.5;

export const FONT_SIZE = 11;
export const FONT_WEIGHT = 400;
export const FONT_WEIGHT = 450;

export const HEIGHT = 16;

Expand Down
9 changes: 5 additions & 4 deletions packages/polaris-viz/src/data/character-width-offsets.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
"10": 0.85,
"11": 0.92,
"12": 1,
"13": 1.07,
"13": 1.08,
"14": 1.15,
"15": 1.22,
"15": 1.23,
"16": 1.3,
"17": 1.37,
"18": 1.45,
Expand All @@ -29,7 +29,7 @@
"26": 2.04,
"27": 2.12,
"28": 2.2,
"29": 2.27,
"29": 2.28,
"30": 2.35,
"31": 2.43,
"32": 2.51,
Expand All @@ -47,7 +47,8 @@
"200": 0.97,
"300": 0.99,
"400": 1,
"500": 1.03,
"450": 1.04,
"500": 1.04,
"600": 1.06,
"700": 1.09,
"800": 1.14,
Expand Down
6 changes: 6 additions & 0 deletions scripts/character-widths/build-character-offsets.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@
);
});

// we will need to add the Uplift font weights eventually
// for now I'm just adding 450 manually
characters.fontWeight[450] = getWidthWithBaseline(
getWidth(null, FONT_SIZE, 450),
);

let string = JSON.stringify(characters);
string = string.replace(' ', ' ');

Expand Down

0 comments on commit 498de25

Please sign in to comment.