Skip to content

Commit

Permalink
Use process.argv only in CLI version
Browse files Browse the repository at this point in the history
In the web version, process.argv does not contain the font conversion
options.
  • Loading branch information
neuschaefer committed Mar 23, 2024
1 parent 7f9f29f commit 91a14b1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ List of characters to copy, belongs to previously declared "--font". Examples:
//

let args = parser.parse_args(argv.length ? argv : [ '-h' ]);
args.opts_string = process.argv.slice(2).join(' ');

for (let font of args.font) {
if (font.ranges.length === 0) {
Expand Down
2 changes: 1 addition & 1 deletion lib/writers/lvgl/lv_font.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class LvFont extends Font {
return `/*******************************************************************************
* Size: ${this.src.size} px
* Bpp: ${this.opts.bpp}
* Opts: ${process.argv.slice(2).join(' ')}
* Opts: ${this.opts.opts_string}
******************************************************************************/
#ifdef LV_LVGL_H_INCLUDE_SIMPLE
Expand Down
2 changes: 2 additions & 0 deletions web/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ document.querySelector('#converterForm').addEventListener('submit', function han
lv_fallback: _fallback
};

args.opts_string = '';

convert(args).then(result => {
const blob = new Blob([ result[_name] ], { type: 'text/plain;charset=utf-8' });

Expand Down

0 comments on commit 91a14b1

Please sign in to comment.