Skip to content

Commit 8db101b

Browse files
committed
chore: Default "font-variation-settings" values correctly set for the segment labels.
1 parent 060b2ac commit 8db101b

File tree

2 files changed

+22
-11
lines changed

2 files changed

+22
-11
lines changed

packages/webui/src/client/styles/countdown/director.scss

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,18 +82,23 @@ $hold-status-color: $liveline-timecode-color;
8282
vertical-align: middle;
8383
color: #fff;
8484
position: relative;
85-
font-weight: 700;
85+
//font-weight: 700;
8686
font-size: 100px;
8787
line-height: 110%;
8888
height: 11vh;
8989
/* or 110px */
9090
letter-spacing: 0.01em;
91-
font-feature-settings: 'pnum' on, 'lnum' on;
91+
font-feature-settings: 'tnum' on, 'liga' off;
9292

9393
color: #ffffff;
94-
font-stretch: 100;
95-
font-variation-settings: 'GRAD' -90, 'XOPQ' 96, 'XTRA' 372, 'YOPQ' 79, 'YTAS' 750, 'YTDE' -203, 'YTFI' 738,
96-
'YTLC' 514, 'YTUC' 712, 'slnt' 0, 'opsz' 38;
94+
//font-stretch: 100;
95+
96+
// Default Roboto Flex settings:
97+
font-variation-settings: 'GRAD' 0, 'XOPQ' 96, 'XTRA' 468, 'YOPQ' 79, 'YTAS' 750, 'YTDE' -203, 'YTFI' 738, 'YTLC' 514, 'YTUC' 712,
98+
'opsz' 100,
99+
'slnt' 0,
100+
'wdth' 100,
101+
'wght' 550;
97102

98103
text-shadow: 0px 0px 4px rgba(0, 0, 0, 0.5);
99104
box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.5);
@@ -126,9 +131,12 @@ $hold-status-color: $liveline-timecode-color;
126131
padding-left: 8vw;
127132
padding-top: 6px;
128133
color: #ff0;
129-
font-stretch: 40;
130-
font-variation-settings: 'GRAD' 0, 'XOPQ' 96, 'XTRA' 468, 'YOPQ' 79, 'YTAS' 750, 'YTDE' -203, 'YTFI' 738,
131-
'YTLC' 548, 'YTUC' 712, 'slnt' 0, 'opsz' 100;
134+
//font-stretch: 40;
135+
font-variation-settings: 'GRAD' 0, 'XOPQ' 96, 'XTRA' 468, 'YOPQ' 79, 'YTAS' 750, 'YTDE' -203, 'YTFI' 738, 'YTLC' 514, 'YTUC' 712,
136+
'opsz' 100,
137+
'slnt' 0,
138+
'wdth' 100,
139+
'wght' 550;
132140

133141
background: linear-gradient(
134142
90deg,

packages/webui/src/client/ui/util/AdjustLabelFit.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export const AdjustLabelFit: React.FC<AdjustLabelFitProps> = ({
9090
fontSize,
9191
minFontWidth = 50,
9292
maxFontWidth = 120,
93-
defaultOpticalSize = 120,
93+
defaultOpticalSize = 100,
9494
defaultWidth = 100,
9595
useLetterSpacing = false,
9696
minLetterSpacing = -1,
@@ -151,7 +151,9 @@ export const AdjustLabelFit: React.FC<AdjustLabelFitProps> = ({
151151
resetLabelStyles()
152152

153153
// Apply the new width setting
154-
labelElement.style.fontVariationSettings = `'opsz' ${defaultOpticalSize}, 'wdth' ${defaultWidth}`
154+
//labelElement.style.fontVariationSettings = `'opsz' ${defaultOpticalSize}, 'wdth' ${defaultWidth}`
155+
labelElement.style.fontVariationSettings = `'GRAD' 0, 'XOPQ' 96, 'XTRA' 468, 'YOPQ' 79, 'YTAS' 750, 'YTDE' -203, 'YTFI' 738, 'YTLC' 514, 'YTUC' 712, 'opsz' ${defaultOpticalSize}, 'slnt' 0, 'wdth' ${defaultWidth}, 'wght' 550`
156+
155157
// Reset label content if it was cut
156158
labelElement.textContent = label
157159

@@ -181,7 +183,8 @@ export const AdjustLabelFit: React.FC<AdjustLabelFitProps> = ({
181183
currentWidth = Math.max(currentWidth, minFontWidth)
182184
currentWidth = Math.min(currentWidth, maxFontWidth)
183185

184-
labelElement.style.fontVariationSettings = `'opsz' ${defaultOpticalSize}, 'wdth' ${currentWidth}`
186+
//labelElement.style.fontVariationSettings = `'opsz' ${defaultOpticalSize}, 'wdth' ${currentWidth}`
187+
labelElement.style.fontVariationSettings = `'GRAD' 0, 'XOPQ' 96, 'XTRA' 468, 'YOPQ' 79, 'YTAS' 750, 'YTDE' -203, 'YTFI' 738, 'YTLC' 514, 'YTUC' 712, 'opsz' ${defaultOpticalSize}, 'slnt' 0, 'wdth' ${currentWidth}, 'wght' 550`
185188

186189
// Remeasure text width after adjustment:
187190
void labelElement.offsetWidth

0 commit comments

Comments
 (0)