Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
kojiishi committed Aug 8, 2021
1 parent 62d8911 commit e311533
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
23 changes: 19 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ You can run [unit tests] to verify your installation if needed.

## Adding the features to your fonts

### Usage
### Command Line Usage

The following example adds the feature to `input-font-file`
and saves it to the `build` directory.
Expand Down Expand Up @@ -157,14 +157,29 @@ but not to other fonts in the TTC.
east-asian-spacing --index=0,1 input-font-file.ttc
```

## API

```python
import east_asian_spacing

async def main_async():
builder = east_asian_spacing.Builder("fonts/input.otf")
output_path = await builder.build_and_save("build")
if output_path:
print(f"Saved to {output_path}")
else:
print("Skipped")
```

## Advanced Topics
[Advanced Topics]: #advanced-topics

### Algorithm
[Algorithm]: #algorithm

This package determines the glyph pairs to adjust spacings
by a pre-defined set of Unicode code points.
by a set of Unicode code points
defined in the [`Config` class].

Then for each pair, it computes if the spacings are applicable
by examining glyph outlines and computing ink bounding boxes of glyphs.
Expand Down Expand Up @@ -237,8 +252,8 @@ in [`tests/config_test.py`].
The [chws_tool] project is another example
of how to customize this package.

[`Config` class]: east_asian_spacing/config.py
[`tests/config_test.py`]: tests/config_test.py
[`Config` class]: https://github.com/kojiishi/east_asian_spacing/blob/main/east_asian_spacing/config.py
[`tests/config_test.py`]: https://github.com/kojiishi/east_asian_spacing/blob/main/tests/config_test.py

### HarfBuzz

Expand Down
2 changes: 1 addition & 1 deletion precommit.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
set -e

yapf -ir -vv east_asian_spacing tests
yapf -ir -vv .
# pytest -v
tox -p
pytype east_asian_spacing

0 comments on commit e311533

Please sign in to comment.