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.55.0.tar.gz (2.0 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.55.0-pp311-pypy311_pp73-win_amd64.whl (1.3 MB view details)

Uploaded PyPyWindows x86-64

uharfbuzz-0.55.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.55.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.55.0-pp311-pypy311_pp73-macosx_11_0_arm64.whl (1.3 MB view details)

Uploaded PyPymacOS 11.0+ ARM64

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

Uploaded PyPymacOS 10.15+ x86-64

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

Uploaded CPython 3.10+Windows x86-64

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

Uploaded CPython 3.10+Windows x86

uharfbuzz-0.55.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.55.0-cp310-abi3-musllinux_1_2_aarch64.whl (2.8 MB view details)

Uploaded CPython 3.10+musllinux: musl 1.2+ ARM64

uharfbuzz-0.55.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (1.9 MB view details)

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

uharfbuzz-0.55.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.55.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.55.0.tar.gz.

File metadata

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

File hashes

Hashes for uharfbuzz-0.55.0.tar.gz
Algorithm Hash digest
SHA256 a29bda4c147c35240a71051315423b1933b46eac558a72f55d9ffdc1f2bbb69f
MD5 31aa1856712e7e5828668c8e84a41012
BLAKE2b-256 0c2d25769d2262cafcea748aac7bfb2b9eeb0a9fe2a759b4154133a6d9f39870

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for uharfbuzz-0.55.0-pp311-pypy311_pp73-win_amd64.whl
Algorithm Hash digest
SHA256 212af03a8d17abb05dfda52f5a6f99e4dfa86e5caea3d27164f2948483fe10ad
MD5 16447092b8c421efe8ed5b2d7d05457f
BLAKE2b-256 d498c275b026a28e367327240b3f0bc057fdf478983550143f90b167c687a3eb

See more details on using hashes here.

Provenance

The following attestation bundles were made for uharfbuzz-0.55.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.55.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.55.0-pp311-pypy311_pp73-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 9f9d48d9d13e63ba3f6f089df6bc9fbfc2341411bce9792d701838935dc790aa
MD5 c708dbb2d6091e1f61d4876eb2173f8b
BLAKE2b-256 9d4f7ea7a73418ce580ee2072151a508c7c3eed23723ed49960c45d147e13557

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for uharfbuzz-0.55.0-pp311-pypy311_pp73-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 d8ec4912a8ab1013dea1ca14fb06df5462fed61c154c492215ec696a57579d8f
MD5 bcbff93c2325b8658ea48382bb864311
BLAKE2b-256 03b6d23c5887ff130da4fa08a49b71f062dd60c48f678d1c3b27229750937325

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for uharfbuzz-0.55.0-pp311-pypy311_pp73-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a573876c051c427aa701e4018962950e1fa53b4c627970d63e3f64957a028a5c
MD5 7e8a4be5415fe09e843568d9069593b1
BLAKE2b-256 9d6aab43a4363737e3450ace1b2fe3df40c9d1dd3a55bf906e6d8635cbec92a9

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for uharfbuzz-0.55.0-pp311-pypy311_pp73-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 d9d376898581a4e544ad6ed0f19178050963a0bbc5aee3bdc590fcd4d0eb5d32
MD5 1c147860592650769f80b0665803936f
BLAKE2b-256 18b71325872f79b2460e053ab838c0a7c7dddc5d56987a37a88798820d171995

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: uharfbuzz-0.55.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.55.0-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 72f653625e33f68dda56b258b4b9dcd2ff9c9e4f21fd53c7bbff9d9620c4fba0
MD5 6b29bf5c286077f2b20c5e9dcda62f12
BLAKE2b-256 bff848c018bb9458243ac7dbdecbc3923d6f688c5e96a6afe75146901463cde7

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: uharfbuzz-0.55.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.55.0-cp310-abi3-win32.whl
Algorithm Hash digest
SHA256 4d880af9e5b6f353945b5f5cd43c6989a01eb14ba327323b6b53f9c831ced801
MD5 5d90166126abe86a0e90993697547270
BLAKE2b-256 fdd6630c5c2813892f40b4a43427898685fbe75d809a68307c1e72d38f631aee

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for uharfbuzz-0.55.0-cp310-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 22415eaa87c670fac764053edfaebce1e05babd2cecb0e933170019ed3263109
MD5 713a8dddd5722b5f5c42966f03f18355
BLAKE2b-256 683eefa383c10b79dbd28fecb3f2ef6012e5d125b6b20c3174bf046d2a127dbd

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for uharfbuzz-0.55.0-cp310-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 7daeb0ba227246ed8a5a59f64fa23ecec282bc0af13167752d51ae304d20852a
MD5 a15f4e27e5618a7e8e46a44875f34f6e
BLAKE2b-256 5140cc980e006c9a6ff503764fca5a6012c582a0b4b52460a7c56ea07357e80b

See more details on using hashes here.

Provenance

The following attestation bundles were made for uharfbuzz-0.55.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.55.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.55.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 d594f9e02a21745846477f02e13e900bfe9a697bad975fb3c26e241b7a8256c1
MD5 2e51668cd9f84387dc39406009ec5667
BLAKE2b-256 a145a9ad3ccc3dc731c1df8df7f4c4ae24b266c0bff71cc2a83dd28f7cdbc6d7

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for uharfbuzz-0.55.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 13304721967d55e9718200453cae30f7952f95244af4b0fcb4561e8b456f5357
MD5 5695233e8ab09404d0d233167426b15d
BLAKE2b-256 d756706b3f41dc72f8c578bdecda4ecf132cff3d3fa7aeab76fff64c4e6eabf2

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for uharfbuzz-0.55.0-cp310-abi3-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 40df0ff4d0c7af29c07a8adc614fb0dd421d9c4d8a139362a80a4ceb71e94a71
MD5 3d69ed5f78e11ca6464955ff7818d35b
BLAKE2b-256 ba058e4e62ee1d1f7a1060168bc5af14aa203b9d310a3eb7e97bae00d1b7dc1d

See more details on using hashes here.

Provenance

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