Skip to main content

Streamlined Cython bindings for the harfbuzz shaping engine

Project description

Githun CI Status PyPI


Streamlined Cython bindings for the HarfBuzz shaping engine.


import sys

import uharfbuzz as hb

fontfile = sys.argv[1]
text = sys.argv[2]

blob = hb.Blob.from_file_path(fontfile)
face = hb.Face(blob)
font = hb.Font(face)

buf = hb.Buffer()

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

infos = buf.glyph_infos
positions = buf.glyph_positions

for info, pos in zip(infos, positions):
    gid = info.codepoint
    cluster = info.cluster
    x_advance = pos.x_advance
    x_offset = pos.x_offset
    y_offset = pos.y_offset

How to make a release

Use git tag -a to make a new annotated tag, or git tag -s for a GPG-signed annotated tag, if you prefer.

Name the new tag with with a leading ‘v’ followed by three MAJOR.MINOR.PATCH digits, like in semantic versioning. Look at the existing tags for examples.

In the tag message write some short release notes describing the changes since the previous tag. The subject line will be the release name and the message body will be the release notes.

Finally, push the tag to the remote repository (e.g. assuming upstream is called origin):

$ git push origin v0.4.3

This will trigger the CI to build the distribution packages and upload them to the Python Package Index automatically, if all the tests pass successfully. The CI will also automatically create a new Github Release and use the content of the annotated git tag for the release notes.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution (1.7 MB view hashes)

Uploaded source

Built Distributions

uharfbuzz-0.37.3-cp312-cp312-win_amd64.whl (1.1 MB view hashes)

Uploaded cp312

uharfbuzz-0.37.3-cp312-cp312-win32.whl (840.4 kB view hashes)

Uploaded cp312

uharfbuzz-0.37.3-cp311-cp311-win_amd64.whl (1.1 MB view hashes)

Uploaded cp311

uharfbuzz-0.37.3-cp311-cp311-win32.whl (840.3 kB view hashes)

Uploaded cp311

uharfbuzz-0.37.3-cp310-cp310-win_amd64.whl (1.1 MB view hashes)

Uploaded cp310

uharfbuzz-0.37.3-cp310-cp310-win32.whl (839.2 kB view hashes)

Uploaded cp310

uharfbuzz-0.37.3-cp39-cp39-win_amd64.whl (1.1 MB view hashes)

Uploaded cp39

uharfbuzz-0.37.3-cp39-cp39-win32.whl (839.3 kB view hashes)

Uploaded cp39

uharfbuzz-0.37.3-cp38-cp38-win_amd64.whl (1.1 MB view hashes)

Uploaded cp38

uharfbuzz-0.37.3-cp38-cp38-win32.whl (840.4 kB view hashes)

Uploaded cp38

uharfbuzz-0.37.3-cp37-cp37m-win_amd64.whl (1.1 MB view hashes)

Uploaded cp37

uharfbuzz-0.37.3-cp37-cp37m-win32.whl (836.8 kB view hashes)

Uploaded cp37

uharfbuzz-0.37.3-cp36-cp36m-win_amd64.whl (1.2 MB view hashes)

Uploaded cp36

uharfbuzz-0.37.3-cp36-cp36m-win32.whl (919.2 kB view hashes)

Uploaded cp36

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page