File tree 2 files changed +8
-5
lines changed
2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -63,7 +63,8 @@ Input font can be:
63
63
} else if ( arg == "--spaceWidth" ) {
64
64
options . spaceWidth = parseInt ( process . argv [ ++ i ] ) ;
65
65
} else if ( arg == "--test" ) {
66
- options . test = process . argv [ ++ i ] ;
66
+ if ( ! options . tests ) options . tests = [ ] ;
67
+ options . tests . push ( process . argv [ ++ i ] ) ;
67
68
} else if ( arg == "--ojs" ) {
68
69
options . ojs = process . argv [ ++ i ] ;
69
70
} else if ( arg == "--oh" ) {
@@ -105,8 +106,8 @@ if (options.debug) {
105
106
font . debugChars ( ) ;
106
107
font . debugPixelsUsed ( ) ;
107
108
}
108
- if ( options . test )
109
- font . printString ( options . test ) ;
109
+ if ( options . tests )
110
+ options . tests . forEach ( test => font . printString ( test ) ) ;
110
111
if ( options . ojs )
111
112
require ( "fs" ) . writeFileSync ( options . ojs , Buffer . from ( font . getJS ( ) ) )
112
113
if ( options . oh )
Original file line number Diff line number Diff line change @@ -404,6 +404,8 @@ function loadPBFF(fontInfo) {
404
404
} else if ( l . startsWith ( "line-height" ) ) {
405
405
if ( ! fontInfo . fmHeight ) // if no height specified
406
406
fontInfo . fmHeight = 0 | l . split ( " " ) [ 1 ] ;
407
+ if ( ! fontInfo . height ) // if no height specified
408
+ fontInfo . height = 0 | l . split ( " " ) [ 1 ] ;
407
409
} else if ( l . startsWith ( "glyph" ) ) {
408
410
current = { } ;
409
411
current . idx = parseInt ( l . trim ( ) . split ( " " ) [ 1 ] ) ;
@@ -421,10 +423,10 @@ function loadPBFF(fontInfo) {
421
423
current . bmp . push ( l ) ;
422
424
if ( l . length > fontInfo . fmWidth ) fontInfo . fmWidth = l . length ;
423
425
if ( current . bmp . length > fontInfo . fmHeight ) {
424
- console . log ( current . idx + " bump height to " + current . bmp . length ) ;
426
+ console . log ( "Char " + current . idx + " bump height to " + current . bmp . length ) ;
425
427
fontInfo . fmHeight = current . bmp . length ;
426
428
}
427
- } else if ( l != "" && ! l . startsWith ( "# " ) ) console . log ( `Unknown line '${ l } '` ) ;
429
+ } else if ( l != "" && ! l . startsWith ( "// " ) ) console . log ( `Unknown line '${ l } '` ) ;
428
430
} ) ;
429
431
430
432
fontInfo . generateGlyphs ( function ( ch , x , y ) {
You can’t perform that action at this time.
0 commit comments