File tree Expand file tree Collapse file tree 1 file changed +16
-4
lines changed
shared/features/thumbnail Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Original file line number Diff line number Diff line change 11/* eslint-disable @typescript-eslint/no-var-requires */
2+ import { console } from 'inspector' ;
23import type Path from 'path' ;
34
45import type NapiRs from '@napi-rs/canvas' ;
@@ -45,10 +46,21 @@ if (typeof document === 'undefined') {
4546 const saveToImage = ( canvas : NapiRs . Canvas ) => canvas . encode ( 'png' ) ;
4647
4748 const useFont = ( ) => {
48- GlobalFonts . registerFromPath (
49- getPath ( 'assets/fonts/Lato-Regular.ttf' ) . toString ( ) ,
50- 'Lato' ,
51- ) ;
49+ const path = getPath ( 'assets/fonts/Lato-Regular.ttf' ) . toString ( ) ;
50+ console . log ( 'Font path: ' , path ) ;
51+
52+ // ensure the file exists
53+ Bun . file ( path )
54+ . exists ( )
55+ . then ( ( exists ) => {
56+ if ( exists ) {
57+ console . log ( 'Font file exists' ) ;
58+ } else {
59+ console . error ( 'Font file does not exist at path: ' , path ) ;
60+ }
61+ } ) ;
62+
63+ GlobalFonts . registerFromPath ( path , 'Lato' ) ;
5264 } ;
5365
5466 let noteBlockImage : Promise < any > ;
You can’t perform that action at this time.
0 commit comments