@xingwangzhe/stalux 1.28.0 → 1.28.1
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.
package/package.json
CHANGED
|
@@ -201,7 +201,9 @@ export function writePageFontSubset(
|
|
|
201
201
|
const codeStack = originalCodeStack
|
|
202
202
|
? `${originalCodeStack},"LXGW WenKai-Page Subset"`
|
|
203
203
|
: `"LXGW WenKai-Page Subset",${fallbackStack}`;
|
|
204
|
-
|
|
204
|
+
// The source font is regular; advertise a weight range so browsers synthesize
|
|
205
|
+
// bold weights from these same glyphs instead of falling back to system CJK.
|
|
206
|
+
const css = `@font-face{font-family:"LXGW WenKai-Page Subset";src:url("${rel}") format("woff2");font-style:normal;font-weight:100 900;font-display:swap;unicode-range:${[...chars].map((c) => `U+${c.codePointAt(0)?.toString(16).toUpperCase()}`).join(",")}}:root{--font-body:"LXGW WenKai-Page Subset",${fallbackStack};--font-code:${codeStack}}body{font-family:var(--font-body),${fallbackStack}}`;
|
|
205
207
|
const withoutBroadBodyFonts = html.replace(
|
|
206
208
|
/@font-face\{[^}]*font-family:"LXGW WenKai-[^"]+"[^}]*\}/g,
|
|
207
209
|
(face) => {
|