All Projects → redox-os → Rusttype

redox-os / Rusttype

Licence: other
Mirror of https://gitlab.redox-os.org/redox-os/rusttype

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to Rusttype

perplexed
OTF monospace typeface, a derivative of IBM Plex Mono with Powerline glyphs added
Stars: ✭ 23 (-95.59%)
Mutual labels:  font, opentype
font-v
Font version string reporting and modification library + executable tool
Stars: ✭ 15 (-97.12%)
Mutual labels:  font, opentype
fdiff
An OpenType table diff tool for fonts. Based on the fontTools TTX format.
Stars: ✭ 33 (-93.67%)
Mutual labels:  font, opentype
Source Han Super Otc
Source Han & Noto CJK Mega/Ultra OTCs
Stars: ✭ 153 (-70.63%)
Mutual labels:  font, opentype
Xits
XITS - OpenType implementation of STIX fonts with math support
Stars: ✭ 257 (-50.67%)
Mutual labels:  font, opentype
Typography
C# Font Reader (TrueType / OpenType / OpenFont / CFF / woff / woff2) , Glyphs Layout and Rendering
Stars: ✭ 246 (-52.78%)
Mutual labels:  font, opentype
chiron-sans-hk
昭源黑體:現代筆形風格,平衡標準字形和印刷體慣用筆形的免費開源黑體字型
Stars: ✭ 131 (-74.86%)
Mutual labels:  font, opentype
Source Han Code Jp
Source Han Code JP | 源ノ角ゴシック Code
Stars: ✭ 1,362 (+161.42%)
Mutual labels:  font, opentype
rapid-arrows-font
OTF comic font
Stars: ✭ 30 (-94.24%)
Mutual labels:  font, opentype
bitsnpicas
Bits'N'Picas - Bitmap & Emoji Font Creation & Conversion Tools
Stars: ✭ 171 (-67.18%)
Mutual labels:  font, opentype
Fonts
✒️ Font loading and drawing library.
Stars: ✭ 135 (-74.09%)
Mutual labels:  font, opentype
Libertinus
The Libertinus font family
Stars: ✭ 518 (-0.58%)
Mutual labels:  font, opentype
Fonttools Opentype Feature Freezer
OTFeatureFreezer GUI app and pyftfeatfreeze commandline tool in Python to permanently "apply" OpenType features to fonts, by remapping their Unicode assignments
Stars: ✭ 130 (-75.05%)
Mutual labels:  font, opentype
punk-otf
Punk Nova - an OpenType implementation of Donald Knuth's Punk font
Stars: ✭ 37 (-92.9%)
Mutual labels:  font, opentype
Adobe Variable Font Prototype
Variable font example in OpenType-CFF2 & TrueType formats
Stars: ✭ 116 (-77.74%)
Mutual labels:  font, opentype
xits
XITS - OpenType implementation of STIX fonts with math support
Stars: ✭ 299 (-42.61%)
Mutual labels:  font, opentype
Free Font
大概是2020年最全的免费可商用字体,这里收录的商免字体都能找到明确的授权出处,可以放心使用,持续更新中...
Stars: ✭ 1,140 (+118.81%)
Mutual labels:  font, opentype
Source Han Sans
Source Han Sans | 思源黑体 | 思源黑體 | 思源黑體 香港 | 源ノ角ゴシック | 본고딕
Stars: ✭ 10,181 (+1854.13%)
Mutual labels:  font, opentype
emojione-color
OpenType-SVG font of EmojiOne 2.3
Stars: ✭ 112 (-78.5%)
Mutual labels:  font, opentype
Opentype.js
Read and write OpenType fonts using JavaScript.
Stars: ✭ 3,393 (+551.25%)
Mutual labels:  font, opentype

RustType

crates.io docs.rs

RustType is a pure Rust alternative to libraries like FreeType.

The current capabilities of RustType:

  • Reading OpenType formatted fonts and font collections. This includes *.ttf as well as *.otf font files.
  • Retrieving glyph shapes and commonly used properties for a font and its glyphs.
  • Laying out glyphs horizontally using horizontal and vertical metrics, and glyph-pair-specific kerning.
  • Rasterising glyphs with sub-pixel positioning using an accurate analytical algorithm (not based on sampling).
  • Managing a font cache on the GPU with the gpu_cache module. This keeps recently used glyph renderings in a dynamic cache in GPU memory to minimise texture uploads per-frame. It also allows you keep the draw call count for text very low, as all glyphs are kept in one GPU texture.

Notable things that RustType does not support yet:

  • Font hinting.
  • Ligatures of any kind.
  • Some less common TrueType sub-formats.
  • Right-to-left and vertical text layout.

Testing & examples

Heavier examples, tests & benchmarks are in the ./dev directory. This avoids dev-dependency feature bleed.

Run all tests with cargo test --all --all-features.

Run examples with cargo run --example <NAME> -p dev

Getting Started

To hit the ground running with RustType, look at dev/examples/ascii.rs supplied with the crate. It demonstrates loading a font file, rasterising an arbitrary string, and displaying the result as ASCII art. If you prefer to just look at the documentation, the entry point for loading fonts is Font, from which you can access individual fonts, then their glyphs.

Future Plans

The initial motivation for the project was to provide easy-to-use font rendering for games. There are numerous avenues for improving RustType. Ideas:

  • Support for some common forms of ligatures.
  • And, eventually, support for embedded right-to-left Unicode text.

If you think you could help with achieving any of these goals, feel free to open a tracking issue for discussing them.

Minimum supported rust compiler

This crate is maintained with latest stable rust.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

See Also

  • glyph_brush - can cache vertex generation & provides more complex layouts.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].