Skip to main content

Streamlined Cython bindings for the harfbuzz shaping engine

Project description

uharfbuzz

uharfbuzz Logo

Build + Deploy PyPI Documentation Status

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
    glyph_name = font.glyph_to_string(gid)
    cluster = info.cluster
    x_advance = pos.x_advance
    y_advance = pos.y_advance
    x_offset = pos.x_offset
    y_offset = pos.y_offset
    print(
        f"{glyph_name=} {gid=} {cluster=} "
        f"{x_advance=} {y_advance=} "
        f"{x_offset=} {y_offset=}"
    )

Installation

When building the uharfbuzz package, it automatically incorporates minimal HarfBuzz sources so you don't have to install the native HarfBuzz library.

However, if you want to use uharfbuzz with your system-provided HarfBuzz (e.g., if you built it from sources with custom configuration), you can set USE_SYSTEM_LIBS=1 environment variable (see example below).

USE_SYSTEM_LIBS=1 pip install uharfbuzz --no-binary :uharfbuzz:

harfbuzz installation is found using pkg-config, so you must have harfbuzz's .pc files in your system. If you've built it from sources, meson installs them automatically. Otherwise, you may want to install harfbuzz development package, like harfbuzz-devel on Fedora-derived distros.

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.53.7.tar.gz (1.9 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

uharfbuzz-0.53.7-pp311-pypy311_pp73-win_amd64.whl (1.3 MB view details)

Uploaded PyPyWindows x86-64

uharfbuzz-0.53.7-pp311-pypy311_pp73-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (1.6 MB view details)

Uploaded PyPymanylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

uharfbuzz-0.53.7-pp311-pypy311_pp73-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl (1.5 MB view details)

Uploaded PyPymanylinux: glibc 2.17+ ARM64manylinux: glibc 2.28+ ARM64

uharfbuzz-0.53.7-pp311-pypy311_pp73-macosx_11_0_arm64.whl (1.3 MB view details)

Uploaded PyPymacOS 11.0+ ARM64

uharfbuzz-0.53.7-pp311-pypy311_pp73-macosx_10_15_x86_64.whl (1.4 MB view details)

Uploaded PyPymacOS 10.15+ x86-64

uharfbuzz-0.53.7-cp310-abi3-win_amd64.whl (1.3 MB view details)

Uploaded CPython 3.10+Windows x86-64

uharfbuzz-0.53.7-cp310-abi3-win32.whl (1.0 MB view details)

Uploaded CPython 3.10+Windows x86

uharfbuzz-0.53.7-cp310-abi3-musllinux_1_2_x86_64.whl (2.8 MB view details)

Uploaded CPython 3.10+musllinux: musl 1.2+ x86-64

uharfbuzz-0.53.7-cp310-abi3-musllinux_1_2_aarch64.whl (2.7 MB view details)

Uploaded CPython 3.10+musllinux: musl 1.2+ ARM64

uharfbuzz-0.53.7-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (1.8 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

uharfbuzz-0.53.7-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl (1.7 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ ARM64manylinux: glibc 2.28+ ARM64

uharfbuzz-0.53.7-cp310-abi3-macosx_10_9_universal2.whl (2.9 MB view details)

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

File details

Details for the file uharfbuzz-0.53.7.tar.gz.

File metadata

  • Download URL: uharfbuzz-0.53.7.tar.gz
  • Upload date:
  • Size: 1.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for uharfbuzz-0.53.7.tar.gz
Algorithm Hash digest
SHA256 c13cfe32accd4dc5b7e5d1c3c7bd5f04ba77be186ffd249ab1ba82a0b25b70bc
MD5 bfe8f595c4b356e13036772b6cdc9e5e
BLAKE2b-256 2e9aa4405fb7ee37ce89c670e721e110221f54ec37e3ed5311d6a0f2b9936388

See more details on using hashes here.

Provenance

The following attestation bundles were made for uharfbuzz-0.53.7.tar.gz:

Publisher: ci.yml on harfbuzz/uharfbuzz

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file uharfbuzz-0.53.7-pp311-pypy311_pp73-win_amd64.whl.

File metadata

File hashes

Hashes for uharfbuzz-0.53.7-pp311-pypy311_pp73-win_amd64.whl
Algorithm Hash digest
SHA256 5f5ff5084c58da43998ea274261653dd70b6f92980207df4f97ec026ad9e50a5
MD5 5b3f8fff35007772fd78754195fc7fb0
BLAKE2b-256 36872c532a89d73a0bf2b35c9cb4394ea615912b46518f63151be5f03e496eab

See more details on using hashes here.

Provenance

The following attestation bundles were made for uharfbuzz-0.53.7-pp311-pypy311_pp73-win_amd64.whl:

Publisher: ci.yml on harfbuzz/uharfbuzz

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file uharfbuzz-0.53.7-pp311-pypy311_pp73-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for uharfbuzz-0.53.7-pp311-pypy311_pp73-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 1dcc20c952fb1ea5a662f9471b1d0f1d9fe1d9ffc185e6931d3a484032c76173
MD5 2c682ca1eb3703b9e7959fb188ca0365
BLAKE2b-256 4332d6707e2401f2b05cd9ec91170e5c2444e48e66874b34d97f563168e45121

See more details on using hashes here.

Provenance

The following attestation bundles were made for uharfbuzz-0.53.7-pp311-pypy311_pp73-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl:

Publisher: ci.yml on harfbuzz/uharfbuzz

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file uharfbuzz-0.53.7-pp311-pypy311_pp73-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for uharfbuzz-0.53.7-pp311-pypy311_pp73-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 91acf0335695e68ed9b11ba193cb045ef0c1045002670bfb2c78a6a7b1da8c7e
MD5 49cc6464b53dc24d88beb509a6d72bc3
BLAKE2b-256 bd8dab9115f088bcdd3fd8776ffda0c63d1cb376608ccc3eded61293bf15f7a4

See more details on using hashes here.

Provenance

The following attestation bundles were made for uharfbuzz-0.53.7-pp311-pypy311_pp73-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl:

Publisher: ci.yml on harfbuzz/uharfbuzz

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file uharfbuzz-0.53.7-pp311-pypy311_pp73-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for uharfbuzz-0.53.7-pp311-pypy311_pp73-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 49682dcea4d0bf5adff0141e24f1f09a84dc7a9d2e63a373928452b2d5106ca5
MD5 f797b22905d08e52ee0d52911e81e071
BLAKE2b-256 084277531fdd7a03280e4152d15112ba4042da0fbe25560235cd940d00130461

See more details on using hashes here.

Provenance

The following attestation bundles were made for uharfbuzz-0.53.7-pp311-pypy311_pp73-macosx_11_0_arm64.whl:

Publisher: ci.yml on harfbuzz/uharfbuzz

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file uharfbuzz-0.53.7-pp311-pypy311_pp73-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for uharfbuzz-0.53.7-pp311-pypy311_pp73-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 ce68e0cf5dc9d62f924b51e3a426c68ec09a8f6a9aabb0d81f5c7b6da46771d8
MD5 18028e745ee0820b9675e573173a6993
BLAKE2b-256 fe028920096e63bdc477ec5b2b83046309b50c365cfb454515d7caa4d2fcdf21

See more details on using hashes here.

Provenance

The following attestation bundles were made for uharfbuzz-0.53.7-pp311-pypy311_pp73-macosx_10_15_x86_64.whl:

Publisher: ci.yml on harfbuzz/uharfbuzz

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file uharfbuzz-0.53.7-cp310-abi3-win_amd64.whl.

File metadata

  • Download URL: uharfbuzz-0.53.7-cp310-abi3-win_amd64.whl
  • Upload date:
  • Size: 1.3 MB
  • Tags: CPython 3.10+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for uharfbuzz-0.53.7-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 e425caf07655d25248c251198af81430726fc7644e94a46cbd90537f5ee74c37
MD5 8fb1436b4f4e89f01470bf5598c996ed
BLAKE2b-256 065eacc6098254b68ebb7bee3fcd2f8c8c3caa75a7699f616598d93208bb2e29

See more details on using hashes here.

Provenance

The following attestation bundles were made for uharfbuzz-0.53.7-cp310-abi3-win_amd64.whl:

Publisher: ci.yml on harfbuzz/uharfbuzz

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file uharfbuzz-0.53.7-cp310-abi3-win32.whl.

File metadata

  • Download URL: uharfbuzz-0.53.7-cp310-abi3-win32.whl
  • Upload date:
  • Size: 1.0 MB
  • Tags: CPython 3.10+, Windows x86
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for uharfbuzz-0.53.7-cp310-abi3-win32.whl
Algorithm Hash digest
SHA256 264bc22ee6b7e74cebdc8f60be668aa38af8444f2261971bb4972e19896c8ece
MD5 918c4f1420bd22d72848112e6de10407
BLAKE2b-256 7ec48734964043ca8938eef8a550193c3ee5b9913272775ba845b6be1bfb5745

See more details on using hashes here.

Provenance

The following attestation bundles were made for uharfbuzz-0.53.7-cp310-abi3-win32.whl:

Publisher: ci.yml on harfbuzz/uharfbuzz

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file uharfbuzz-0.53.7-cp310-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for uharfbuzz-0.53.7-cp310-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 5a9849d84a2c9909c82255b63964fa4bef08f64df26da895d0410dd4c6dc62b1
MD5 8389ae08ec0b26a52bf0315c373ee11a
BLAKE2b-256 b5f28e6db5f9aea07cd372b6edf70c6348a0add7882705e031061078cf0ce9c3

See more details on using hashes here.

Provenance

The following attestation bundles were made for uharfbuzz-0.53.7-cp310-abi3-musllinux_1_2_x86_64.whl:

Publisher: ci.yml on harfbuzz/uharfbuzz

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file uharfbuzz-0.53.7-cp310-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for uharfbuzz-0.53.7-cp310-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 685148d4f20bafa76e99ef2b9a712a110efba4eb375188fab2be44e96bfa8cf4
MD5 dbf1fb83a21c436760b70b8f2d775888
BLAKE2b-256 ab9003fdaf96df2ce49093787455c50cf6426239579e10fdd034a2b61ebbb0b1

See more details on using hashes here.

Provenance

The following attestation bundles were made for uharfbuzz-0.53.7-cp310-abi3-musllinux_1_2_aarch64.whl:

Publisher: ci.yml on harfbuzz/uharfbuzz

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file uharfbuzz-0.53.7-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for uharfbuzz-0.53.7-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 806c0ad7ff4fa3547bba3935e151235e31a170ce2aa3ba50cd65ac783eba1f3e
MD5 26767652af3d337390339e81c0f33d0c
BLAKE2b-256 02afb3b81a52032d4777876327dacfbdee091d7c7e4f083c581546533967c1ec

See more details on using hashes here.

Provenance

The following attestation bundles were made for uharfbuzz-0.53.7-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl:

Publisher: ci.yml on harfbuzz/uharfbuzz

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file uharfbuzz-0.53.7-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for uharfbuzz-0.53.7-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 74be5dd76b3161b8dfa1faaff2267582dd3c912e5f91ad66826d827d4db3b582
MD5 8a8df9db9f7852bdd3ceb6ab7e54ef02
BLAKE2b-256 c9813e9e063be1aef14327cd980586875e0982bc0c8f096b214ba8f3a632e1e6

See more details on using hashes here.

Provenance

The following attestation bundles were made for uharfbuzz-0.53.7-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl:

Publisher: ci.yml on harfbuzz/uharfbuzz

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file uharfbuzz-0.53.7-cp310-abi3-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for uharfbuzz-0.53.7-cp310-abi3-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 e277c71d989f3828bd640ade178f5632b76c11aa3e06de049f01b86cd972f05f
MD5 b3813c2c11a594ca0f3f7d477469ee8a
BLAKE2b-256 56efa3ab6349f74ac9c133aeba9575144f12cde56456922654d1e86db6e57f6a

See more details on using hashes here.

Provenance

The following attestation bundles were made for uharfbuzz-0.53.7-cp310-abi3-macosx_10_9_universal2.whl:

Publisher: ci.yml on harfbuzz/uharfbuzz

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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