Skip to content

Commit

Permalink
[skrifa] autohint: capture styles from GSUB (#1161)
Browse files Browse the repository at this point in the history
This adds "best effort" support for using `GSUB` to assign styles to glyphs that are not present in `cmap`.

Per discussion, the new shaping behavior is feature gated (and enabled by default) to support testing against FreeType (-HarfBuzz) with fauntlet which is a known good configuration.
  • Loading branch information
dfrg authored Sep 30, 2024
1 parent 8e80c41 commit ade1598
Show file tree
Hide file tree
Showing 12 changed files with 1,573 additions and 119 deletions.
4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ core_maths = "0.1"
font-test-data = { path = "font-test-data" }
font-types = { version = "0.7.1", path = "font-types" }
read-fonts = { version = "0.22.0", path = "read-fonts", default-features = false }
skrifa = { version = "0.22.0", path = "skrifa" }
# Disable default-features so that fauntlet can use skrifa without autohint
# shaping support
skrifa = { version = "0.22.0", path = "skrifa", default-features = false, features = ["std"] }
write-fonts = { version = "0.29.0", path = "write-fonts" }

[workspace.metadata.release]
Expand Down
3 changes: 3 additions & 0 deletions font-test-data/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ pub static NOTOSERIFHEBREW_AUTOHINT_METRICS: &[u8] =
pub static NOTOSERIFTC_AUTOHINT_METRICS: &[u8] =
include_bytes!("../test_data/ttf/notoseriftc_autohint_metrics.ttf");

pub static NOTOSERIF_AUTOHINT_SHAPING: &[u8] =
include_bytes!("../test_data/ttf/notoserif_autohint_shaping.ttf");

pub static TTHINT_SUBSET: &[u8] = include_bytes!("../test_data/ttf/tthint_subset.ttf");

pub static VORG: &[u8] = include_bytes!("../test_data/ttf/vorg.ttf");
Expand Down
10 changes: 10 additions & 0 deletions font-test-data/test_data/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,16 @@ Describes the provenance, usage and generation procedures for font data used for
pyftsubset NotoSerifTC-Regular.ttf --text=他你們和对就我時来能說这齊军已既是民现理置軍配開露顾个人以你個到大對我時来要说主因想理當着者著过进過還面些你們和她將年情样理說这通即吧呢响师收斷眼间陈除随隨事學將想政新樣沒然现球經起例别动吗增明期物种调费都间田囗
```

* _notoserif_autohint_shaping_
* font: Noto Serif Regular
* source: https://fonts.google.com/noto/specimen/Noto+Serif
* license: [Open Font License][OFL]
* usage: testing autohinting shaper capture of OpenType features
* subset: fi ligatures and c2sc support
```shell
pyftsubset notoserif-regular.ttf --layout-features+=c2sc --no-hinting --text=Hfix
```

* _avar2checker_
* font: avar2 checker
* source: https://github.com/Lorp/fencer/tree/main/src/fonts
Expand Down
Binary file not shown.
Loading

0 comments on commit ade1598

Please sign in to comment.