@@ -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