koishi-plugin-ll-mc 3.1.12 → 3.1.14
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.
|
Binary file
|
package/lib/index.js
CHANGED
|
@@ -61,8 +61,8 @@ var usage = `## 📝 使用说明
|
|
|
61
61
|
详细选项请发送 \`help messageCounter\` 查看。`;
|
|
62
62
|
var logger = new import_koishi.Logger("messageCounter");
|
|
63
63
|
var FONT_OPTIONS = {
|
|
64
|
-
TITLE: "
|
|
65
|
-
NICKNAME: "
|
|
64
|
+
TITLE: "NotoSans-Regular",
|
|
65
|
+
NICKNAME: "NotoSans-Regular"
|
|
66
66
|
};
|
|
67
67
|
var Config = import_koishi.Schema.intersect([
|
|
68
68
|
// --- 核心功能 ---
|
|
@@ -283,7 +283,7 @@ async function apply(ctx, config) {
|
|
|
283
283
|
} catch (error) {
|
|
284
284
|
logger.warn("无法加载 fallbackBase64.json,将使用空的回退头像。", error);
|
|
285
285
|
}
|
|
286
|
-
const fontFiles = ["
|
|
286
|
+
const fontFiles = ["NotoSans-Regular.ttf", "NotoEmoji.ttf"];
|
|
287
287
|
for (const fontFile of fontFiles) {
|
|
288
288
|
await copyAssetIfNotExists(
|
|
289
289
|
import_path.default.join(assetsDir, "fonts"),
|
|
@@ -1793,7 +1793,7 @@ ${targetUserRecord[0].username}
|
|
|
1793
1793
|
let context = canvas.getContext('2d');
|
|
1794
1794
|
|
|
1795
1795
|
// 根据最大计数的文本宽度动态调整画布宽度,以防数字溢出
|
|
1796
|
-
context.font = \`30px "\${config.chartNicknameFont}",
|
|
1796
|
+
context.font = \`30px "\${config.chartNicknameFont}", NotoSans-Regular, "Microsoft YaHei", sans-serif, "NotoEmoji"\`;
|
|
1797
1797
|
// 找到拥有最大发言数的条目,因为它的文本通常最长
|
|
1798
1798
|
const maxCountData = rankingData.find(d => d.count === maxCount) || rankingData[0] || { count: 1, percentage: 0 };
|
|
1799
1799
|
let maxCountText = maxCount.toString();
|
|
@@ -1877,7 +1877,7 @@ ${targetUserRecord[0].username}
|
|
|
1877
1877
|
|
|
1878
1878
|
async function drawTextAndIcons(context, data, index, avgColor, barX, barY, barWidth, barHeight) {
|
|
1879
1879
|
// 字体栈包含了用户选择的字体、插件内置字体和通用字体,以确保兼容性。
|
|
1880
|
-
context.font = \`30px "\${config.chartNicknameFont}",
|
|
1880
|
+
context.font = \`30px "\${config.chartNicknameFont}", NotoSans-Regular, "Microsoft YaHei", sans-serif, "NotoEmoji"\`;
|
|
1881
1881
|
const textY = barY + barHeight / 2 + 10.5;
|
|
1882
1882
|
|
|
1883
1883
|
|
|
@@ -2482,9 +2482,12 @@ ${targetUserRecord[0].username}
|
|
|
2482
2482
|
<meta charset="UTF-8">
|
|
2483
2483
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
2484
2484
|
<style>
|
|
2485
|
-
/*
|
|
2486
|
-
|
|
2485
|
+
/* 数字:内嵌极小(约3KB)的纯 0-9 字体并锁死,避免被系统 emoji 字体(自带 0-9 且字宽极宽)撑成 "2 9 1 7"。
|
|
2486
|
+
用 base64 内嵌,保证 setContent 回退路径下也生效。 */
|
|
2487
2487
|
${digitsFontFaceCss}
|
|
2488
|
+
/* emoji:用内置的紧身 emoji 字体(墨迹几乎填满字身),而系统 emoji 字体两侧各留约 0.19em 空白,
|
|
2489
|
+
那正是"emoji 两边像有空格"的来源。相对路径 fonts/ 由 file:// 页面解析(模板已写入该目录)。 */
|
|
2490
|
+
@font-face { font-family: 'LLMCEmoji'; src: url("fonts/NotoEmoji.ttf") format('truetype'); }
|
|
2488
2491
|
* { box-sizing: border-box; margin: 0; padding: 0; }
|
|
2489
2492
|
html, body {
|
|
2490
2493
|
width: 900px;
|
|
@@ -2493,7 +2496,7 @@ ${targetUserRecord[0].username}
|
|
|
2493
2496
|
background-color: #F5F7FA;
|
|
2494
2497
|
}
|
|
2495
2498
|
body {
|
|
2496
|
-
font-family: "LLMCDigits", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji";
|
|
2499
|
+
font-family: "LLMCDigits", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "LLMCEmoji", "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji";
|
|
2497
2500
|
-webkit-font-smoothing: antialiased;
|
|
2498
2501
|
}
|
|
2499
2502
|
.card {
|
package/package.json
CHANGED
|
Binary file
|