Skip to content

Commit 779ee85

Browse files
committed
First swing at a readme update
1 parent bd0ddd9 commit 779ee85

File tree

2 files changed

+35
-39
lines changed

2 files changed

+35
-39
lines changed

Cargo.toml

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
[package]
2-
name = "rustybuzz"
3-
version = "0.17.0"
4-
authors = ["Yevhenii Reizner <[email protected]>"]
2+
name = "harfruzz"
3+
version = "0.0.1"
54
edition = "2021"
65
description = "A complete harfbuzz shaping algorithm port to Rust."
7-
documentation = "https://docs.rs/rustybuzz/"
6+
documentation = "https://docs.rs/harfruzz/"
87
readme = "README.md"
9-
repository = "https://github.com/RazrFalcon/rustybuzz"
8+
repository = "https://github.com/harfbuzz/harfruzz"
109
license = "MIT"
1110
keywords = ["text", "shaping", "opentype", "truetype"]
1211
categories = ["text-processing"]
@@ -27,6 +26,7 @@ skrifa = { git = "https://github.com/googlefonts/fontations", rev = "2eb4b1c" }
2726
wasmi = { version = "0.34.0", optional = true }
2827
log = "0.4.22"
2928

29+
# TODO: remove entirely
3030
[dependencies.ttf-parser]
3131
git = "https://github.com/RazrFalcon/ttf-parser"
3232
rev = "85c1ff2"

README.md

+30-34
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,41 @@
1-
# rustybuzz
2-
![Build Status](https://github.com/RazrFalcon/rustybuzz/workflows/Rust/badge.svg)
3-
[![Crates.io](https://img.shields.io/crates/v/rustybuzz.svg)](https://crates.io/crates/rustybuzz)
4-
[![Documentation](https://docs.rs/rustybuzz/badge.svg)](https://docs.rs/rustybuzz)
1+
# harfruzz
2+
![Build Status](https://github.com/harfbuzz/harfruzz/workflows/Rust/badge.svg)
3+
[![Crates.io](https://img.shields.io/crates/v/harfruzz.svg)](https://crates.io/crates/harfruzz)
4+
[![Documentation](https://docs.rs/harfruzz/badge.svg)](https://docs.rs/harfruzz)
5+
6+
`harfruzz` is a fork of [`rustybuzz`](https://docs.rs/rustybuzz) to explore porting from `ttf-parser` to
7+
[`read-fonts`](https://docs.rs/read-fonts) to avoid shipping (and maintaining)
8+
multiple implementations of core font parsing for [`skrifa`](https://docs.rs/skrifa) consumers.
9+
Further context in https://github.com/googlefonts/fontations/issues/956.
510

611
`rustybuzz` is a complete [harfbuzz](https://github.com/harfbuzz/harfbuzz)'s
712
shaping algorithm port to Rust.
813

9-
Matches `harfbuzz` v9.0.0
14+
Matches `harfbuzz` [v9.0.0](https://github.com/harfbuzz/harfbuzz/releases/tag/9.0.0).
1015

1116
## Why?
1217

13-
Because you can add `rustybuzz = "*"` to your project and it just works.
14-
No need for a C++ compiler. No need to configure anything. No need to link to system libraries.
18+
https://github.com/googlefonts/oxidize outlines Google Fonts motivations to try to migrate font
19+
production and consumption to Rust.
1520

1621
## Conformance
1722

18-
rustybuzz passes nearly all of harfbuzz shaping tests (2221 out of 2252 to be more precise).
19-
So it's mostly identical, but there are still some tiny edge-cases which
20-
are not implemented yet or cannot be implemented at all.
23+
The following conformance issues need to be fixed:
24+
25+
* harfruzz does not yet fully pass the harfbuzz shaping or fuzzing tests
26+
* Malformed fonts will cause an error
27+
* HarfBuzz uses fallback/dummy shaper in this case
28+
* No Arabic fallback shaper (requires subsetting)
29+
* `avar2` as well as other parts of the boring-expansion-spec are not supported yet.
2130

2231
## Major changes
2332

24-
- Subsetting removed.
25-
- TrueType parsing is completely handled by the
26-
[ttf-parser](https://github.com/RazrFalcon/ttf-parser).
27-
And while the parsing algorithm is very different, it's not better or worse, just different.
28-
- Malformed fonts will cause an error. HarfBuzz uses fallback/dummy shaper in this case.
2933
- No font size property. Shaping is always using UnitsPerEm. You should scale the result manually.
3034
- Most of the TrueType and Unicode handling code was moved into separate crates.
31-
- rustybuzz doesn't interact with any system libraries and must produce exactly the same
35+
- harfruzz doesn't interact with any system libraries and must produce exactly the same
3236
results on all OS'es and targets.
3337
- `mort` table is not supported, since it's deprecated by Apple.
34-
- No Arabic fallback shaper, since it requires subsetting.
3538
- No `graphite` library support.
36-
- `avar2` as well as other parts of the boring-expansion-spec are not supported yet.
3739

3840
## Performance
3941

@@ -43,32 +45,26 @@ See [benches/README.md](./benches/README.md) for details.
4345

4446
## Notes about the port
4547

46-
rustybuzz is not a faithful port.
48+
harfruzz is not a faithful port.
4749

48-
harfbuzz can roughly be split into 6 parts: shaping, subsetting, TrueType parsing,
49-
Unicode routines, custom containers and utilities (harfbuzz doesn't use C++ std)
50-
and glue for system/3rd party libraries. In the mean time, rustybuzz contains only shaping.
51-
All of the TrueType parsing was moved to the [ttf-parser](https://github.com/RazrFalcon/ttf-parser).
52-
Subsetting was removed. Unicode code was mostly moved to external crates.
53-
We don't need custom containers because Rust's std is good enough.
54-
And we do not use any non Rust libraries, so no glue code either.
50+
harfbuzz (C++ edition) can roughly be split into 6 parts:
5551

56-
In the end, we still have around 23 KLOC. While harfbuzz is around 80 KLOC.
52+
1. shaping, handled by harfruzz
53+
1. subsetting, (`hb-subset`) moves to a standalone crate, [klippa](https://github.com/googlefonts/fontations/tree/main/klippa)
54+
1. TrueType parsing, handled by [`read-fonts`](https://docs.rs/read-fonts)
55+
1. Unicode routines, migrated to external crates
56+
1. custom containers and utilities (harfbuzz doesn't use C++ std), reimplemented in [`fontations`](https://github.com/googlefonts/fontations) where appropriate (e.g. int set)
57+
1. glue for system/3rd party libraries, just gone
5758

5859
## Lines of code
5960

60-
As mentioned above, rustybuzz has around 23 KLOC. But this is not strictly true,
61-
because there are a lot of auto-generated data tables.
62-
63-
You can find the "real" code size using:
61+
You can find the "real" code size (eliminating generated code) using:
6462

6563
```sh
6664
tokei --exclude hb/unicode_norm.rs --exclude hb/ot_shaper_vowel_constraints.rs \
6765
--exclude '*_machine.rs' --exclude '*_table.rs' src
6866
```
6967

70-
Which gives us around 17 KLOC, which is still a lot.
71-
7268
## Future work
7369

7470
Since the port is finished, there is not much to do other than syncing it with
@@ -121,6 +117,6 @@ But except that, there are no `unsafe` in this library and in most of its depend
121117

122118
## License
123119

124-
`rustybuzz` is licensed under the **MIT**.
120+
`harfruzz` is licensed under the **MIT** license.
125121

126122
`harfbuzz` is [licensed](https://github.com/harfbuzz/harfbuzz/blob/master/COPYING) under the **Old MIT**

0 commit comments

Comments
 (0)