Skip to content

Commit d659cfa

Browse files
committed
small tweaks - use different line comment chars
1 parent 0f735c6 commit d659cfa

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

cli/fontconverter.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ Input font can be:
6363
} else if (arg=="--spaceWidth") {
6464
options.spaceWidth = parseInt(process.argv[++i]);
6565
} else if (arg=="--test") {
66-
options.test = process.argv[++i];
66+
if (!options.tests) options.tests=[];
67+
options.tests.push(process.argv[++i]);
6768
} else if (arg=="--ojs") {
6869
options.ojs = process.argv[++i];
6970
} else if (arg=="--oh") {
@@ -105,8 +106,8 @@ if (options.debug) {
105106
font.debugChars();
106107
font.debugPixelsUsed();
107108
}
108-
if (options.test)
109-
font.printString(options.test);
109+
if (options.tests)
110+
options.tests.forEach(test => font.printString(test));
110111
if (options.ojs)
111112
require("fs").writeFileSync(options.ojs, Buffer.from(font.getJS()))
112113
if (options.oh)

fontconverter.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,8 @@ function loadPBFF(fontInfo) {
404404
} else if (l.startsWith("line-height")) {
405405
if (!fontInfo.fmHeight) // if no height specified
406406
fontInfo.fmHeight = 0|l.split(" ")[1];
407+
if (!fontInfo.height) // if no height specified
408+
fontInfo.height = 0|l.split(" ")[1];
407409
} else if (l.startsWith("glyph")) {
408410
current = {};
409411
current.idx = parseInt(l.trim().split(" ")[1]);
@@ -421,10 +423,10 @@ function loadPBFF(fontInfo) {
421423
current.bmp.push(l);
422424
if (l.length > fontInfo.fmWidth) fontInfo.fmWidth = l.length;
423425
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);
425427
fontInfo.fmHeight = current.bmp.length;
426428
}
427-
} else if (l!="" && !l.startsWith("#")) console.log(`Unknown line '${l}'`);
429+
} else if (l!="" && !l.startsWith("//")) console.log(`Unknown line '${l}'`);
428430
});
429431

430432
fontInfo.generateGlyphs(function(ch,x,y) {

0 commit comments

Comments
 (0)