Skip to content
An example for using font-atlas crates
Rust
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
assets/fonts
atlas-gen
src
.gitignore
Cargo.lock
Cargo.toml
README.md

README.md

Steps

Clone repo and build the atlas generator Note: this requires Freetype to be setup for your machine

git clone https://github.com/viperscape/font-atlas-example
cd font-atlas-example
cd atlas-gen
cargo build

Build an atlas from a font Note: here we choose a font and font-size of 20 This example generator was sourced from TyOverby's example

cd ..
./atlas-gen/target/debug/atlas_gen assets/fonts/SourceCodePro-Regular.otf 20

ls assets/fonts/
SourceCodePro-Regular-20.bincode  SourceCodePro-Regular-20.png  SourceCodePro-Regular.otf

You'll see that there is a png and bincode file representing the font in atlas format. Let's move on to building the render example (in the root of the project folder) to show our HelloWorld example on screen.

cargo run
You can’t perform that action at this time.