This commit is contained in:
手瓜一十雪
2025-03-26 12:32:54 +08:00
parent 31fdffde36
commit 4d26ec737b
3 changed files with 8 additions and 7 deletions

View File

@@ -1,9 +1,10 @@
import { dirname, join } from 'node:path';
import { NCoreInitShell } from './base';
import { GlobalFonts } from '@napi-rs/canvas';
import { fileURLToPath } from 'node:url';
import { current_path } from '@/plugin/data';
import path from 'path';
let current_path = dirname(fileURLToPath(import.meta.url));
GlobalFonts.registerFromPath(join(current_path, '.\\fonts\\JetBrainsMono.ttf'), 'JetBrains Mono');
GlobalFonts.registerFromPath(join(current_path, '.\\fonts\\AaCute.ttf', 'Aa偷吃可爱长大的'));
GlobalFonts.registerFromPath(path.join(current_path, './fonts/JetBrainsMono.ttf'), 'JetBrains Mono');
GlobalFonts.registerFromPath(path.join(current_path, './fonts/AaCute.ttf'), 'Aa偷吃可爱长大的');
console.log('字体注册完成');
NCoreInitShell();