MCPcopy Create free account
hub / github.com/TeleBoxOrg/TeleBox_Plugins / ensureCjkFont

Function ensureCjkFont

cy/cy.ts:30–42  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

28let cjkFontRegistered = false;
29
30function ensureCjkFont(): void {
31 if (cjkFontRegistered) return;
32 for (const fontPath of CJK_FONT_CANDIDATES) {
33 if (!fs.existsSync(fontPath)) continue;
34 try {
35 registerFont(fontPath, { family: CJK_FONT_FAMILY });
36 cjkFontRegistered = true;
37 break;
38 } catch (error) {
39 console.warn(`[cy] 注册中文字体失败: ${fontPath}`, error);
40 }
41 }
42}
43
44const STOP_WORDS = new Set([
45 "这个", "那个", "就是", "不是", "可以", "没有", "一下", "一个", "什么", "怎么", "为什么",

Callers 1

renderWordCloudFunction · 0.85

Calls 1

warnMethod · 0.80

Tested by

no test coverage detected