Generate a Font Information CSV File ​
Usage ​
Run the following commands in the gen-font-info directory:
shell
npm install
node index.js <input-path> [output-path] [output-override=true]Parameters ​
input-path: Path to font files. Supported forms:
Font file URL that returns a font file with
content-typeofapplication/octet-stream.Font list URL that returns JSON with
content-typeofapplication/json, in the format["font-a-url", "font-b-url", ...].Local font file path (absolute or relative).
Local font folder path. All font files in this folder and subfolders are processed. Supports absolute and relative paths.
output-path: Path for the generated CSV file. Defaults to
fontInfo.csvin the current directory.output-override: Whether to overwrite an existing CSV file. Defaults to
true. Iffalse, new font information is appended to the existing CSV.
Examples ​
Font file URL ​
shell
node index.js http://localhost:8080/fonts/Bradhitc_M.ttf ./fontInfo.csvFont list URL ​
shell
node index.js http://localhost:8080/fonts.json ./fontInfo.csvLocal font file path ​
shell
# Relative path
node index.js ./fonts/arial.ttf ./fontInfo.csv
node index.js ./fonts ./fontInfo.csv
# Absolute path
# win
node index.js D:\fonts\Bradhitc_M.ttf E:\fontInfo.csv
node index.js D:\fonts E:\fontInfo.csv
# linux, mac
node index.js /home/fonts/Bradhitc_M.ttf /home/fontInfo.csv
node index.js /home/fonts /home/fontInfo.csvoutput-override ​
shell
node index.js /home/fonts /home/fontInfo.csv false
node index.js /home/fonts false