@lvce-editor/title-bar-worker 4.20.3 → 4.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -4031,11 +4031,15 @@ const measureTextWidths2 = async (texts, fontWeight, fontSize, fontFamily, lette
|
|
|
4031
4031
|
if (typeof letterSpacing !== 'number') {
|
|
4032
4032
|
throw new TypeError('letterSpacing must be of type number');
|
|
4033
4033
|
}
|
|
4034
|
-
|
|
4035
|
-
|
|
4036
|
-
|
|
4037
|
-
|
|
4038
|
-
|
|
4034
|
+
const rpc = await launchTextMeasurementWorker();
|
|
4035
|
+
try {
|
|
4036
|
+
const isMonospaceFont = false;
|
|
4037
|
+
const charWidth = 0;
|
|
4038
|
+
const result = await rpc.invoke('TextMeasurement.measureTextWidths', texts, fontWeight, fontSize, fontFamily, letterSpacing, isMonospaceFont, charWidth);
|
|
4039
|
+
return result;
|
|
4040
|
+
} finally {
|
|
4041
|
+
await rpc[Symbol.asyncDispose]();
|
|
4042
|
+
}
|
|
4039
4043
|
};
|
|
4040
4044
|
|
|
4041
4045
|
const measureTextWidths = async (texts, fontWeight, fontSize, fontFamily, letterSpacing) => measureTextWidths2(texts, fontWeight, fontSize, fontFamily, letterSpacing);
|