| Crates.io | fontheight |
| lib.rs | fontheight |
| version | 0.2.0 |
| created_at | 2025-08-21 10:24:30.836034+00 |
| updated_at | 2025-10-31 12:16:08.317101+00 |
| description | Find out the vertical extents your font reaches on shaped words |
| homepage | |
| repository | https://github.com/googlefonts/fontheight |
| max_upload_size | |
| id | 1804552 |
| size | 63,913 |
fontheight is a tool that provides recommendations on setting font vertical metrics based on shaped words.
Vertical metrics frequently decide clipping boundaries, but are not used consistently across platforms: e.g. Windows uses OS/2 WinAscent/WinDescent, whereas for system fonts Android uses TypoAscent/TypoDescent and a combination of custom heuristics.
It is often desirable to derive metrics from shaped words as opposed to individual glyphs, as words may reach greater extents:
Early versions of this specification suggested that the usWinAscent value be computed as the yMax for all characters in the Windows “ANSI” character set. For new fonts, the value should be determined based on the primary languages the font is designed to support, and should take into consideration additional height that could be required to accommodate tall glyphs or mark positioning.
⬆️ OS/2 — OS/2 and Windows Metrics Table, OpenType Specification 1.9.1
For this reason, vertical metrics must be chosen with a combination of design (e.g. aesthetic, legibility) and engineering (e.g. clipping) considerations in mind.
For the latter, fontheight evaluates the extents of a corpus of shaped text across each writing system that a font intends to support.
Fontheight comes in two flavours:
fontheight as a commandline toolCurrently, both installation methods involve compiling fontheight from its source code, meaning you need to have a Rust toolchain installed and cargo available in your terminal.
If you're new to Rust, check out https://www.rust-lang.org/tools/install for instructions on getting it installed and configured.
You only need a stable compiler for Font Height's crates.
From crates.io (note: the build script for static-lang-word-lists requires network access, see its README for why):
cargo install --locked fontheight-cli
From GitHub:
STATIC_LANG_WORD_LISTS_LOCAL=1 cargo install --locked --git https://github.com/googlefonts/fontheight fontheight-cli
Note: after installing, the command you run is fontheight (not fontheight-cli).
Usage: fontheight [OPTIONS] <FONT_PATH>...
Arguments:
<FONT_PATH>... The TTF(s) to analyze
Options:
-n, --results <RESULTS> The number of words to log [default: 5]
-k, --words <WORDS_PER_LIST> The number of words from each list to test [default: all words]
-v, --verbose... Increase logging verbosity
-q, --quiet... Decrease logging verbosity
-o, --output <OUTPUT_PATH> Write the reports into the given path. Will print to stdout if not specified
--html Output all the reports into a single HTML file
-h, --help Print help
-V, --version Print version
Most of the word list shipped with fontheight are sorted by greatest vertical extremes to try and help reduce the number of words which need to be checked to produce a useful report, should you not wish to test the full word lists (which may be time consuming).
Sorted DiffenatorAdlam based on:
Sorted DiffenatorArabic based on:
Sorted DiffenatorArmenian based on:
Sorted DiffenatorAvestan based on:
Sorted DiffenatorBengali based on:
Sorted DiffenatorCanadian_Aboriginal based on:
Sorted DiffenatorChakma based on:
Sorted DiffenatorCherokee based on:
Sorted DiffenatorCommon based on:
Sorted DiffenatorCyrillic based on:
Sorted DiffenatorDevanagari based on:
Sorted DiffenatorEthiopic based on:
Sorted DiffenatorGreek based on:
Sorted DiffenatorGujarati based on:
Sorted DiffenatorGurmukhi based on:
Sorted DiffenatorHebrew based on:
Sorted DiffenatorKhmer based on:
Sorted DiffenatorLao based on:
Sorted DiffenatorLatin based on:
Sorted DiffenatorLisu based on:
Sorted DiffenatorMalayalam based on:
Sorted DiffenatorMongolian based on:
Sorted DiffenatorMyanmar based on:
Sorted DiffenatorOl_Chiki based on:
Sorted DiffenatorOriya based on:
Sorted DiffenatorOsage based on:
Sorted DiffenatorSinhala based on:
Sorted DiffenatorSyriac based on:
Sorted DiffenatorTamil based on:
Sorted DiffenatorTelugu based on:
Sorted DiffenatorThai based on:
Sorted DiffenatorTibetan based on:
Sorted DiffenatorVai based on:
fontheight's Rust crateOn crates.io as fontheight.
For documentation, please refer to docs.rs.
static-lang-word-lists Rust crateProvides word lists embedded within the application binary that are compressed at build time, and lazily decompressed at runtime.
See the crate README & documentation for what's available.