Skip to content

Commit

Permalink
Add root README
Browse files Browse the repository at this point in the history
  • Loading branch information
ianthetechie committed Jul 9, 2023
1 parent 53d543d commit dc20425
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# SDF Font Tools

This is a collection of complementary crates for converting fonts into signed distance fields
and combining the results into MapLibre-compatible font stacks. Refer to the individual crate
READMEs for more details.

* [`build_pbf_gliphs`](build_pbf_glyphs) - CLI tool to crunch a directory fonts into PBF files you can host statically
* [`pbf_font_tools`](pbf_font_tools) - Library exposing high level interfaces for generating glyphs from TTF/OTF fonts and combining glyphs from multiple fonts into fontstacks.
* [`sdf_glyph_renderer`](sdf_glyph_renderer) - Library crate for converting SDF glyphs from an arbitrary bitmap (alpha map).
8 changes: 4 additions & 4 deletions build_pbf_glyphs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
This binary crate provides a CLI utility for batch converting a directory of fonts into
signed distance fields, encoded in a protocol buffer for renderers such as Mapbox GL. This
isn't really anything novel; it's just a frontend to
[pbf_font_tools](https://github.com/stadiamaps/pbf_font_tools) that behaves similar to
[pbf_font_tools](../pbf_font_tools) that behaves similar to
[node-fontnik](https://github.com/mapbox/node-fontnik), but is faster and (in our opinion)
a bit easier to use since it doesn't depend on node and all its headaches, or C++ libraries
that need to be built from scratch (this depends on FreeType, but that's widely available on
nearly any *nix-based system).

Check out
[sdf_glyph_renderer](https://github.com/stadiamaps/sdf_glyph_renderer) for more technical
[sdf_glyph_renderer](https://github.com/stadiamaps/sdf_font_tools/tree/main/sdf_glyph_renderer) for more technical
details on how this works.

NOTE: This has requires you to have FreeType installed on your system. We recommend using
Expand All @@ -23,10 +23,10 @@ versions.
## Usage

This tool will create `out_dir` if necessary, and will put each range (of 256 glyphs, for
compatibility with Mapbox fontstack convention) in a new subdirectory bearing the font name.
compatibility with MapLibre/Mapbox fontstack convention) in a new subdirectory bearing the font name.

You can install the released version from crates.io, or grab the latest git version by
running `cargo install --git https://github.com/stadiamaps/build_pbf_glyphs build_pbf_glyphs`.
running `cargo install build_pbf_glyphs`.

```
$ build_pbf_glyphs /path/to/font_dir /path/to/out_dir
Expand Down
2 changes: 1 addition & 1 deletion pbf_font_tools/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ like Mapbox GL.

If you're looking for a CLI tool to generate PBF ranges en masse like
[node-fontnik](https://github.com/mapbox/node-fontnik)), but faster,
check out [build_pbf_glyphs](https://github.com/stadiamaps/build_pbf_glyphs).
check out [build_pbf_glyphs](https://github.com/stadiamaps/sdf_font_tools/tree/main/build_pbf_glyphs).

NOTE: This has been developed and tested against FreeType 2.10. It will work against
older versions, but the glyph generation tests may not pass as the rendering
Expand Down
4 changes: 2 additions & 2 deletions sdf_glyph_renderer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ generate the bitmap. This is quite fast (we're talking µs/glyph), and the resul
almost always indistinguishable from the more sophisticated vector-based approach of
[sdf-glyph-foundry](https://github.com/mapbox/sdf-glyph-foundry).

This crate is used by [pbf_font_tools](https://github.com/stadiamaps/pbf_font_tools) to generate
This crate is used by [pbf_font_tools](https://github.com/stadiamaps/sdf_font_tools/tree/main/pbf_font_tools) to generate
SDF glyphs from any FreeType-readable font. If you're looking for a batch generation tool,
check out [build_pbf_glyphs](https://github.com/stadiamaps/build_pbf_glyphs).
check out [build_pbf_glyphs](https://github.com/stadiamaps/sdf_font_tools/tree/main/build_pbf_glyphs).

# Example Usage

Expand Down

0 comments on commit dc20425

Please sign in to comment.