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 1
1
/* eslint-disable @typescript-eslint/no-var-requires */
2
+ import { console } from 'inspector' ;
2
3
import type Path from 'path' ;
3
4
4
5
import type NapiRs from '@napi-rs/canvas' ;
@@ -45,10 +46,21 @@ if (typeof document === 'undefined') {
45
46
const saveToImage = ( canvas : NapiRs . Canvas ) => canvas . encode ( 'png' ) ;
46
47
47
48
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' ) ;
52
64
} ;
53
65
54
66
let noteBlockImage : Promise < any > ;
You can’t perform that action at this time.
0 commit comments