研究u8g2 bdfconv的用法

1819
bdfconv [options] filename
-h          Display this help
-v          Print log messages
-b <n>      Font build mode, 0: proportional, 1: common height, 2: monospace, 3: multiple of 8
-f <n>      Font format, 0: ucglib font, 1: u8g2 font, 2: u8g2 uncompressed 8x8 font (enforces -b 3)
-m 'map'    Unicode ASCII mapping
-M 'mapfile'    Read Unicode ASCII mapping from file 'mapname'
-o <file>   C output file
-n <name>   C indentifier (font name)
-d <file>   Overview picture: Enable generation of bdf.tga and assign BDF font <file> for description
-l <margin> Overview picture: Set left margin
-a          Overview picture: Additional font information (background, orange&blue dot)
-t          Overview picture: Test string (Woven silk pyjamas exchanged for blue quartz.)
-r          Runtime test

map := <mapcmd> { "," <mapcmd> }
mapcmd := <default> | <maprange> | <exclude>
default := "*"
maprange := <range> [  ">" <addexpr> ]        Move specified glyph <range> to target code <num>
exclude := "~" <range>
range := <addexpr> [ "-" <addexpr> ]          Select glyphs within specified range
addexpr := <mulexpr> [ "+" <mulexpr> ]
mulexpr := <num> [ "*" <num> ]
num := <hexnum> | <decnum>
hexnum := "$" <hexdigit> { <hexdigit> }
decnum := <decdigit> { <decdigit> }
decdigit := "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9"
hexdigit := "a" | "b" | "c" | "d" | "e" | "f" | "A" | "B" | "C" | "D" | "E" | "F" | <decdigit>
{ } zero, one ore more, [ ] zero or once, | alternative
example:
  -m '32-255'     select gylphs from encoding 32 to 255
  -m '32-255,~64' select gylphs from encoding 32 to 255, exclude '@'
  -m '32,48-57'   select space, '1', '2', ... '9'
build modes:
 -b 0: Most compact, glyph bitmap is minimal
 -b 1: Like -b 0, but glyph bitmap is extended to the height of the largest glyph within the selected glyph list.
       Also the width of the gylphs is extended to cover the delta x advance.
 -b 2: Like -b 1, but glyph width is set to the width of the largest glyph within the selected gylph list.
 -b 3: Like -b 2, but width and height are forced to be a multiple of 8.

 

bdfconv.exe -v ../bdf/unifont.bdf -b 0 -f 1 -M ../build/chinese1.map -d ../bdf/7x13.bdf -n u8g2_font_unifont_zgzt -o u8g2_font_unifont_zgzt.c

 

另外自己写了个配合u8g2的图片取模工具:https://clz.me/image-converter/

留下一个答复

Please enter your comment!
Please enter your name here