SDFTool
Signed distance field font and image command line tool based on OpenCL.
Build
Windows
Run cargo build --release
in Visual Studio developer x64 command prompt.
macOS/Linux
Run cargo build --release
in terminal.
Install
Windows
Run cargo install --git https://github.com/Strrationalism/SDFTool.git sdftool
in Visual Studio developer x64 command prompt.
macOS/Linux
Run cargo install --git https://github.com/Strrationalism/SDFTool.git sdftool
in terminal.
Usage
Show OpenCL devices
sdftool cl-devices
Create SDF image for PNG symbol
USAGE:
sdftool symbol [FLAGS] [OPTIONS]
Create SDF font atlas from TTF/OTF
USAGE:
sdftool font [FLAGS] [OPTIONS]
FLAGS:
--cpu Do not use OpenCL.
-h, --help Prints help information
--no-ascii Do not generate ascii charset
--schinese-punc Generate punctuations for schinese
--schinese-1 Generate common standard chinese table 1
--schinese-2 Generate common standard chinese table 2
--schinese-3 Generate common standard chinese table 3
-V, --version Prints version information
OPTIONS:
-c, --charset
... Additional charset to generate
--margin-x
Margin X on every sdf character in pixels [default: 0]
--margin-y
Margin Y on every sdf character in pixels [default: 0]
--origin-scale
Basic font scale before downsample [default: 384] --padding-x
Padding X on every basic character in pixels [default: 24] --padding-y
Padding Y on every basic character in pixels [default: 24] --page-height
Single page height in pixels [default: 1024] --page-width
Single page width in pixels [default: 1024] -r, --search-radius
Set the radius for edge searching [default: 24] -s, --stride
Set the downsample stride size (1 will not downsample) [default: 8] ARGS:
Input ttf/otf file
Output path