koishi-plugin-ll-mc 3.0.2 → 3.0.4
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/lib/index.js
CHANGED
|
@@ -2224,12 +2224,14 @@ ${targetUserRecord[0].username}
|
|
|
2224
2224
|
<div class="font-preload">
|
|
2225
2225
|
<span style="font-family: '${chartConfig.chartNicknameFont}';">预加载</span>
|
|
2226
2226
|
<span style="font-family: '${chartConfig.chartTitleFont}';">预加载</span>
|
|
2227
|
+
<span style="font-family: 'NotoEmoji';">预加载</span>
|
|
2227
2228
|
</div>
|
|
2228
2229
|
<canvas id="rankingCanvas"></canvas>
|
|
2229
2230
|
<script>
|
|
2230
|
-
//
|
|
2231
|
+
// 立即执行的异步函数,用于绘制图表(先等字体加载完,否则 emoji 会画成 "?")
|
|
2231
2232
|
(async () => {
|
|
2232
2233
|
const drawFunction = ${_getClientScript()};
|
|
2234
|
+
try { await document.fonts.ready; } catch (e) {}
|
|
2233
2235
|
await drawFunction(${JSON.stringify(clientData)});
|
|
2234
2236
|
})();
|
|
2235
2237
|
</script>
|
|
@@ -2282,6 +2284,8 @@ ${targetUserRecord[0].username}
|
|
|
2282
2284
|
await page.setContent(import_koishi.h.unescape(htmlContent), {
|
|
2283
2285
|
waitUntil: config.waitUntil
|
|
2284
2286
|
});
|
|
2287
|
+
// 官机补丁:确保 emoji 字体已就绪再截图(否则 canvas 里 emoji 画成 "?")
|
|
2288
|
+
await page.evaluate(() => document.fonts.ready).catch(() => {});
|
|
2285
2289
|
const calculatedWidth = await page.evaluate(() => {
|
|
2286
2290
|
const canvas = document.getElementById(
|
|
2287
2291
|
"rankingCanvas"
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
404: Not Found
|