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


Release history Release notifications | RSS feed

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.54.0.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.54.0-pp311-pypy311_pp73-win_amd64.whl (1.3 MB view details)

Uploaded PyPyWindows x86-64

uharfbuzz-0.54.0-pp311-pypy311_pp73-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (1.7 MB view details)

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

uharfbuzz-0.54.0-pp311-pypy311_pp73-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl (1.6 MB view details)

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

uharfbuzz-0.54.0-pp311-pypy311_pp73-macosx_11_0_arm64.whl (1.4 MB view details)

Uploaded PyPymacOS 11.0+ ARM64

uharfbuzz-0.54.0-pp311-pypy311_pp73-macosx_10_15_x86_64.whl (1.5 MB view details)

Uploaded PyPymacOS 10.15+ x86-64

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

Uploaded CPython 3.10+Windows x86-64

uharfbuzz-0.54.0-cp310-abi3-win32.whl (1.1 MB view details)

Uploaded CPython 3.10+Windows x86

uharfbuzz-0.54.0-cp310-abi3-musllinux_1_2_x86_64.whl (2.9 MB view details)

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

uharfbuzz-0.54.0-cp310-abi3-musllinux_1_2_aarch64.whl (2.8 MB view details)

Uploaded CPython 3.10+musllinux: musl 1.2+ ARM64

uharfbuzz-0.54.0-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.54.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl (1.8 MB view details)

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

uharfbuzz-0.54.0-cp310-abi3-macosx_10_9_universal2.whl (3.0 MB view details)

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

File details

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

File metadata

  • Download URL: uharfbuzz-0.54.0.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.54.0.tar.gz
Algorithm Hash digest
SHA256 9758fe2bae8c6cd1e93bc78dcdc5efc28f909493a6322d7442878624b7e3f291
MD5 52846e675450c7d26bb0dc259aa079e8
BLAKE2b-256 e8b23c66ef2002e56d0dfcc4c38f4f1546f0a82ea7c698eaa7aaa68ad3452be1

See more details on using hashes here.

Provenance

The following attestation bundles were made for uharfbuzz-0.54.0.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.54.0-pp311-pypy311_pp73-win_amd64.whl.

File metadata

File hashes

Hashes for uharfbuzz-0.54.0-pp311-pypy311_pp73-win_amd64.whl
Algorithm Hash digest
SHA256 ef683a2bc033b69091539d05986087973192b2472cb38325781efe35aa344062
MD5 31446105247bf0e319d63bd70554cfbc
BLAKE2b-256 1043d92c8746a38eda82eee5fdfbe655eebf0404ad896d4cb518a298ace68e46

See more details on using hashes here.

Provenance

The following attestation bundles were made for uharfbuzz-0.54.0-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.54.0-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.54.0-pp311-pypy311_pp73-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 6d5725064f4e7fad9153062790ad5b990e7b0e0530cf3565aa7c2a919c752144
MD5 f1f1926bf5f016293c29fa625ee8e854
BLAKE2b-256 fc2e8c7687c4033fe62f81e41b7ca024acff42face28ee7787e9b4cc30270669

See more details on using hashes here.

Provenance

The following attestation bundles were made for uharfbuzz-0.54.0-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.54.0-pp311-pypy311_pp73-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for uharfbuzz-0.54.0-pp311-pypy311_pp73-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 d0b7bb33a97889746ea67718680a3983475c3cc1a4c46d6c9bedf5598b4d2fb4
MD5 2213f53297d1c1393cf900069535f1c2
BLAKE2b-256 44f4bdc8450ed64f3b6c44c3d4fa9c23985ba4ef672af589c262b664b95ae45c

See more details on using hashes here.

Provenance

The following attestation bundles were made for uharfbuzz-0.54.0-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.54.0-pp311-pypy311_pp73-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for uharfbuzz-0.54.0-pp311-pypy311_pp73-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c6be4b7cb6e1b4c1ec64ab1388d4fe81d818700e172cd4651130d31c721bdbf0
MD5 331985b7ae61a11eca93740836d77eb1
BLAKE2b-256 75edc394368c2ccb34a6a4d1a4d61eefd266eda5cd81e1bffe235f81e8a058a2

See more details on using hashes here.

Provenance

The following attestation bundles were made for uharfbuzz-0.54.0-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.54.0-pp311-pypy311_pp73-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for uharfbuzz-0.54.0-pp311-pypy311_pp73-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 12cdfb2b96fa8e3b18dbea3918e33e47c1d2e79a4aef12aa085c3cfaf08db54b
MD5 6c8d009085281d6779655021b7b70d73
BLAKE2b-256 5e9aaa414408c201d10b503ed97461a31269239cf434204e912c6e7070c7da37

See more details on using hashes here.

Provenance

The following attestation bundles were made for uharfbuzz-0.54.0-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.54.0-cp310-abi3-win_amd64.whl.

File metadata

  • Download URL: uharfbuzz-0.54.0-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.54.0-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 6b2de355cab940215bf680a1f9a1a2acc630052f1a5e8cc8b4d59af8d73a7367
MD5 4e7905ccd98e83b76cf206c54c66f8a1
BLAKE2b-256 9ca59f2e380213209c0b8c36f719cb9d65a0337fe8588eb87eb478c2847104eb

See more details on using hashes here.

Provenance

The following attestation bundles were made for uharfbuzz-0.54.0-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.54.0-cp310-abi3-win32.whl.

File metadata

  • Download URL: uharfbuzz-0.54.0-cp310-abi3-win32.whl
  • Upload date:
  • Size: 1.1 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.54.0-cp310-abi3-win32.whl
Algorithm Hash digest
SHA256 2c12ddb48646a2cc7812b9268523f796a377bfa5aff3f91a52114fa9bd0e3a87
MD5 7e15e0dfb0d9e48e1915a218950153f2
BLAKE2b-256 90a91c62175ca872f3c5e4cf0282447c6223acd6624abf58f6d846281bf9cb30

See more details on using hashes here.

Provenance

The following attestation bundles were made for uharfbuzz-0.54.0-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.54.0-cp310-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for uharfbuzz-0.54.0-cp310-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 1ec97e9d39403c0558d27c4dc310b3a15f0caf731b2def954a15dc0e66c647c7
MD5 aeaf42f819b393169e30df3e74106ca5
BLAKE2b-256 a7a939e060e2e3677fcc6b163c487f692b09e5c3aaaf78b1f3efe08471acac92

See more details on using hashes here.

Provenance

The following attestation bundles were made for uharfbuzz-0.54.0-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.54.0-cp310-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for uharfbuzz-0.54.0-cp310-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 ba159b5dc4df898d04e1bf1915608fa1b4efcee3cdcab7752fb2cce60addce4d
MD5 6a13a0bf198ba1413d222dad5ef1c6b6
BLAKE2b-256 9ef02aff3db0cbd1c4e5db8e20a616dd3b02af0a9dfcc0b1a8ee256647f36233

See more details on using hashes here.

Provenance

The following attestation bundles were made for uharfbuzz-0.54.0-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.54.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for uharfbuzz-0.54.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 7f7fa128f57c50f70f98ae25e8a33b389d136c9c5113d14a09b84f231cd8e6fc
MD5 e2dfb2a996fa1833816b8c8378fce626
BLAKE2b-256 6ed3ed3dc5010629d4452745b6070b9bf1ea9409f067d5ff2e866f5617413563

See more details on using hashes here.

Provenance

The following attestation bundles were made for uharfbuzz-0.54.0-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.54.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for uharfbuzz-0.54.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 5d59dfd53ac4e4dfbe5d674f57b27cd08b10e6fca98ed3003b5342047df50ebf
MD5 7eb8207d23fd3e1a2264a435f8199a75
BLAKE2b-256 e0ec5468a6dd5c4a3915b778ad88d70295a59aed77826239d6d892348ac347e6

See more details on using hashes here.

Provenance

The following attestation bundles were made for uharfbuzz-0.54.0-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.54.0-cp310-abi3-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for uharfbuzz-0.54.0-cp310-abi3-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 ee67f94b81621ec48a3e329c261a60fbd6917c6059373b2cb2f01c834763826b
MD5 c43ea5ea39a7a3f34fb483a8bd0c65e7
BLAKE2b-256 b1a7f4ab0c134d3ec0f2913696dca36588bf855159c3945da4bb8d0d6393d22e

See more details on using hashes here.

Provenance

The following attestation bundles were made for uharfbuzz-0.54.0-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