#font-rendering #font #text-rendering

pixglyph

Font-rendering with subpixel positioning

3 releases (breaking)

0.3.0 Dec 18, 2023
0.2.0 Sep 13, 2023
0.1.0 Mar 27, 2023

#48 in Rendering

Download history 500/week @ 2023-12-18 329/week @ 2023-12-25 384/week @ 2024-01-01 502/week @ 2024-01-08 471/week @ 2024-01-15 498/week @ 2024-01-22 502/week @ 2024-01-29 638/week @ 2024-02-05 513/week @ 2024-02-12 415/week @ 2024-02-19 682/week @ 2024-02-26 986/week @ 2024-03-04 1100/week @ 2024-03-11 797/week @ 2024-03-18 578/week @ 2024-03-25 814/week @ 2024-04-01

3,389 downloads per month
Used in 4 crates (2 directly)

Apache-2.0

23KB
285 lines

pixglyph

Crates.io Documentation

OpenType glyph rendering.

[dependencies]
pixglyph = "0.3"

Features

  • Render glyph outlines into coverage bitmaps.
  • Place glyphs at subpixel offsets and scale them to subpixel sizes. This is important if you plan to render more than a single glyph since inter-glyph spacing will look off if every glyph origin must be pixel-aligned.
  • No font data structure you have to store somewhere. Just owned glyphs which you can load individually from a font, cache if you care about performance, and then render at any size.
  • No unsafe code.

License

This crate is licensed under the terms of the Apache 2.0 license.


lib.rs:

OpenType glyph rendering.

  • Render glyph outlines into coverage bitmaps.
  • Place glyphs at subpixel offsets and scale them to subpixel sizes. This is important if you plan to render more than a single glyph since inter-glyph spacing will look off if every glyph origin must be pixel-aligned.
  • No font data structure you have to store somewhere. Just owned glyphs which you can load individually from a font, cache if you care about performance, and then render at any size.
  • No unsafe code.

Note on text: This library does not provide any capabilities to map text/characters to glyph ids. Instead, you should use a proper shaping library (like rustybuzz) to do this step. This will take care of proper glyph positioning, ligatures and more.

Note on emojis: This library only supports normal outlines. How to best render bitmap, SVG and colored glyphs depends very much on your rendering environment.

Dependencies

~670KB
~16K SLoC