Metadata-Version: 2.4
Name: vharfbuzz
Version: 0.3.1
Summary: A user-friendlier way to use Harfbuzz in Python
Author-email: Simon Cozens <simon@simon-cozens.org>
License: MIT License
        
        Copyright (c) 2021 Simon Cozens
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Repository, https://github.com/simoncozens/vharfbuzz
Project-URL: Issues, https://github.com/simoncozens/vharfbuzz/issues
Classifier: Environment :: Console
Classifier: Topic :: Text Processing :: Fonts
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: uharfbuzz>=0.34.0
Requires-Dist: fontTools
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Requires-Dist: black; extra == "dev"
Dynamic: license-file

# vharfbuzz - A user-friendlier way to use Harfbuzz in Python

[uharfbuzz](https://github.com/harfbuzz/uharfbuzz) is an _awesome_ tool for shaping text in Python. But it wraps the Harfbuzz C interface quite closely, so still requires you to perform a bunch of boilerplate operations before you can get on with the shaping. This module allows you a slightly more high-level interface to the text shaping process. For example, rather than:

```python
with open(sys.argv[1], 'rb') as fontfile:
    fontdata = fontfile.read()

text = sys.argv[2]

face = hb.Face(fontdata)
font = hb.Font(face)

buf = hb.Buffer()
buf.add_str(text)
buf.guess_segment_properties()

features = {"kern": True, "liga": True}
hb.shape(font, buf, features)
```

with `vharfbuzz` you can just say:

```python
vhb = Vharfbuzz(sys.argv[1])
buf = vhb.shape(sys.argv[2], {"features": {"kern": True, "liga": True}})
```

The `Vharfbuzz` class also contains a number of other helpful methods to perform common operations on Harfbuzz buffers. See [Read The Docs](https://vharfbuzz.readthedocs.io/en/latest/) for more information.

## Installation

vharfbuzz is available from `pypi`, so can be installed like so:

    pip3 install vharfbuzz

If building from source, you can install it like so:

    pip3 install -r requirements.txt
    pip3 install .
