Skip to main content

Streamlined Cython bindings for the harfbuzz shaping engine

Project description

Githun CI Status PyPI

uharfbuzz

Streamlined Cython bindings for the HarfBuzz shaping engine.

Example

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()
buf.add_str(text)
buf.guess_segment_properties()

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
    print(f"gid{gid}={cluster}@{x_advance},{x_offset}+{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

uharfbuzz-0.23.0.zip (1.2 MB view hashes)

Uploaded Source

Built Distributions

uharfbuzz-0.23.0-pp38-pypy38_pp73-win_amd64.whl (830.7 kB view hashes)

Uploaded PyPy Windows x86-64

uharfbuzz-0.23.0-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.5 MB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

uharfbuzz-0.23.0-pp38-pypy38_pp73-macosx_10_9_x86_64.whl (1.2 MB view hashes)

Uploaded PyPy macOS 10.9+ x86-64

uharfbuzz-0.23.0-pp37-pypy37_pp73-win_amd64.whl (828.5 kB view hashes)

Uploaded PyPy Windows x86-64

uharfbuzz-0.23.0-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.5 MB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

uharfbuzz-0.23.0-pp37-pypy37_pp73-macosx_10_9_x86_64.whl (544.3 kB view hashes)

Uploaded PyPy macOS 10.9+ x86-64

uharfbuzz-0.23.0-cp310-cp310-win_amd64.whl (425.1 kB view hashes)

Uploaded CPython 3.10 Windows x86-64

uharfbuzz-0.23.0-cp310-cp310-win32.whl (359.6 kB view hashes)

Uploaded CPython 3.10 Windows x86

uharfbuzz-0.23.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.9 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

uharfbuzz-0.23.0-cp310-cp310-macosx_11_0_arm64.whl (585.5 kB view hashes)

Uploaded CPython 3.10 macOS 11.0+ ARM64

uharfbuzz-0.23.0-cp310-cp310-macosx_10_9_x86_64.whl (642.7 kB view hashes)

Uploaded CPython 3.10 macOS 10.9+ x86-64

uharfbuzz-0.23.0-cp310-cp310-macosx_10_9_universal2.whl (1.2 MB view hashes)

Uploaded CPython 3.10 macOS 10.9+ universal2 (ARM64, x86-64)

uharfbuzz-0.23.0-cp39-cp39-win_amd64.whl (425.0 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

uharfbuzz-0.23.0-cp39-cp39-win32.whl (359.5 kB view hashes)

Uploaded CPython 3.9 Windows x86

uharfbuzz-0.23.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.9 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

uharfbuzz-0.23.0-cp39-cp39-macosx_11_0_arm64.whl (585.4 kB view hashes)

Uploaded CPython 3.9 macOS 11.0+ ARM64

uharfbuzz-0.23.0-cp39-cp39-macosx_10_9_x86_64.whl (642.6 kB view hashes)

Uploaded CPython 3.9 macOS 10.9+ x86-64

uharfbuzz-0.23.0-cp39-cp39-macosx_10_9_universal2.whl (1.2 MB view hashes)

Uploaded CPython 3.9 macOS 10.9+ universal2 (ARM64, x86-64)

uharfbuzz-0.23.0-cp38-cp38-win_amd64.whl (424.9 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

uharfbuzz-0.23.0-cp38-cp38-win32.whl (359.4 kB view hashes)

Uploaded CPython 3.8 Windows x86

uharfbuzz-0.23.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.9 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

uharfbuzz-0.23.0-cp38-cp38-macosx_11_0_arm64.whl (579.8 kB view hashes)

Uploaded CPython 3.8 macOS 11.0+ ARM64

uharfbuzz-0.23.0-cp38-cp38-macosx_10_9_x86_64.whl (637.5 kB view hashes)

Uploaded CPython 3.8 macOS 10.9+ x86-64

uharfbuzz-0.23.0-cp38-cp38-macosx_10_9_universal2.whl (1.2 MB view hashes)

Uploaded CPython 3.8 macOS 10.9+ universal2 (ARM64, x86-64)

uharfbuzz-0.23.0-cp37-cp37m-win_amd64.whl (422.6 kB view hashes)

Uploaded CPython 3.7m Windows x86-64

uharfbuzz-0.23.0-cp37-cp37m-win32.whl (358.3 kB view hashes)

Uploaded CPython 3.7m Windows x86

uharfbuzz-0.23.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.8 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64

uharfbuzz-0.23.0-cp37-cp37m-macosx_10_9_x86_64.whl (635.3 kB view hashes)

Uploaded CPython 3.7m macOS 10.9+ x86-64

uharfbuzz-0.23.0-cp36-cp36m-win_amd64.whl (490.1 kB view hashes)

Uploaded CPython 3.6m Windows x86-64

uharfbuzz-0.23.0-cp36-cp36m-win32.whl (407.3 kB view hashes)

Uploaded CPython 3.6m Windows x86

uharfbuzz-0.23.0-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.9 MB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.17+ x86-64

uharfbuzz-0.23.0-cp36-cp36m-macosx_10_9_x86_64.whl (637.6 kB view hashes)

Uploaded CPython 3.6m macOS 10.9+ x86-64

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