Skip to main content

Streamlined Cython bindings for the harfbuzz shaping engine

Project description

Travis Build status Appveyor Build status PyPI

uharfbuzz

Streamlined Cython bindings for the HarfBuzz shaping engine.

Example

import uharfbuzz as hb
import sys


with open(sys.argv[1], 'rb') as fontfile:
    fontdata = fontfile.read()

text = sys.argv[2]

face = hb.Face(fontdata)
font = hb.Font(face)
upem = face.upem

font.scale = (upem, upem)
hb.ot_font_set_funcs(font)

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}")

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.4.0.zip (24.8 kB view details)

Uploaded Source

Built Distributions

uharfbuzz-0.4.0-cp37-cp37m-win_amd64.whl (264.8 kB view details)

Uploaded CPython 3.7m Windows x86-64

uharfbuzz-0.4.0-cp37-cp37m-win32.whl (227.7 kB view details)

Uploaded CPython 3.7m Windows x86

uharfbuzz-0.4.0-cp37-cp37m-manylinux1_x86_64.whl (425.6 kB view details)

Uploaded CPython 3.7m

uharfbuzz-0.4.0-cp37-cp37m-macosx_10_6_x86_64.whl (371.1 kB view details)

Uploaded CPython 3.7m macOS 10.6+ x86-64

uharfbuzz-0.4.0-cp36-cp36m-win_amd64.whl (264.9 kB view details)

Uploaded CPython 3.6m Windows x86-64

uharfbuzz-0.4.0-cp36-cp36m-win32.whl (227.5 kB view details)

Uploaded CPython 3.6m Windows x86

uharfbuzz-0.4.0-cp36-cp36m-manylinux1_x86_64.whl (425.6 kB view details)

Uploaded CPython 3.6m

uharfbuzz-0.4.0-cp36-cp36m-macosx_10_6_x86_64.whl (371.7 kB view details)

Uploaded CPython 3.6m macOS 10.6+ x86-64

File details

Details for the file uharfbuzz-0.4.0.zip.

File metadata

  • Download URL: uharfbuzz-0.4.0.zip
  • Upload date:
  • Size: 24.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/2.7.15

File hashes

Hashes for uharfbuzz-0.4.0.zip
Algorithm Hash digest
SHA256 71cd085693bb22e1a2abac08a6c5094433270409b8e4890f8111fde9686ab728
MD5 2950724377259c92e6cbaaa2da54139b
BLAKE2b-256 ab6bb3fbbdd8aefa06475ac14d6217dc9f71302ab448444c1f9f0ff1c8709d0a

See more details on using hashes here.

File details

Details for the file uharfbuzz-0.4.0-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: uharfbuzz-0.4.0-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 264.8 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/2.7.15

File hashes

Hashes for uharfbuzz-0.4.0-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 179e7aa48a4f904c6506d51c57e4973e1c076b09598b96b163f789fc4eac88d5
MD5 545000aae63f8d9308e9f53dd3f781b5
BLAKE2b-256 b5d9f31239ca19be24ce56e382c0d70d62954d12ab0147cfb92ac86702b87ebd

See more details on using hashes here.

File details

Details for the file uharfbuzz-0.4.0-cp37-cp37m-win32.whl.

File metadata

  • Download URL: uharfbuzz-0.4.0-cp37-cp37m-win32.whl
  • Upload date:
  • Size: 227.7 kB
  • Tags: CPython 3.7m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/2.7.15

File hashes

Hashes for uharfbuzz-0.4.0-cp37-cp37m-win32.whl
Algorithm Hash digest
SHA256 61bdb29eab3f7ed0b7213534007486616ef02d5a11873c3ad8d7f8718a01aea9
MD5 8d31587b8e35de97fdc8f270ea0174d0
BLAKE2b-256 599271dc53f31bb7e552893c948d15d3d19503a2e30865f792b8fe5e38c50d06

See more details on using hashes here.

File details

Details for the file uharfbuzz-0.4.0-cp37-cp37m-manylinux1_x86_64.whl.

File metadata

  • Download URL: uharfbuzz-0.4.0-cp37-cp37m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 425.6 kB
  • Tags: CPython 3.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/38.2.4 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/2.7.14

File hashes

Hashes for uharfbuzz-0.4.0-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 92ca68bb2f52fc1e94566e3cec16eaebdbeb29ef21b850fe14176cb70d4230f8
MD5 93502b78455cb55a11feb50473c48642
BLAKE2b-256 a5c0e3580eb68816ef222cc8286c254b1e8f2c3c386e27b24e81d2b8b7734e42

See more details on using hashes here.

File details

Details for the file uharfbuzz-0.4.0-cp37-cp37m-macosx_10_6_x86_64.whl.

File metadata

  • Download URL: uharfbuzz-0.4.0-cp37-cp37m-macosx_10_6_x86_64.whl
  • Upload date:
  • Size: 371.1 kB
  • Tags: CPython 3.7m, macOS 10.6+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/2.7.15

File hashes

Hashes for uharfbuzz-0.4.0-cp37-cp37m-macosx_10_6_x86_64.whl
Algorithm Hash digest
SHA256 45ab9f0e0df86394bb6ce3f58b5900c23b1562b917122db3bfc8271a97bca3af
MD5 29f922a0169d2152ba84557d6101629a
BLAKE2b-256 9949d8da29d150318860d485b0059e8c54c4e66e625fcc226fc924aa4b7314c0

See more details on using hashes here.

File details

Details for the file uharfbuzz-0.4.0-cp36-cp36m-win_amd64.whl.

File metadata

  • Download URL: uharfbuzz-0.4.0-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 264.9 kB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/2.7.15

File hashes

Hashes for uharfbuzz-0.4.0-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 6c7b74a541ec7a84fd63c04adafc3d57f880865d2cbd1e57937e43353486daa9
MD5 5de82446445007fd494588b1f9278f1d
BLAKE2b-256 22a12f3dd7a7836f90049eb8bfffac3c0a00ef6b1c6eba314737b0342aaf36d5

See more details on using hashes here.

File details

Details for the file uharfbuzz-0.4.0-cp36-cp36m-win32.whl.

File metadata

  • Download URL: uharfbuzz-0.4.0-cp36-cp36m-win32.whl
  • Upload date:
  • Size: 227.5 kB
  • Tags: CPython 3.6m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/2.7.15

File hashes

Hashes for uharfbuzz-0.4.0-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 d08028365b99674b5ce16e21706a79b862e9554606547b72c0d633b49ced22fb
MD5 8cea33bbaf36ca0982954342e468b968
BLAKE2b-256 ba16559ec71e1981ee57888e0d95591bae3f23aeb69f5e089e770d70e9ddbf6a

See more details on using hashes here.

File details

Details for the file uharfbuzz-0.4.0-cp36-cp36m-manylinux1_x86_64.whl.

File metadata

  • Download URL: uharfbuzz-0.4.0-cp36-cp36m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 425.6 kB
  • Tags: CPython 3.6m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/38.2.4 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/2.7.14

File hashes

Hashes for uharfbuzz-0.4.0-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 1aeae0e7d05ff00d220d3263327ff7ae15e6c2fb59df818152347285d2819cc4
MD5 9183fa46224a56b8cb416d5838817cb0
BLAKE2b-256 91ac3aaf8a2f61d95ee10b65063fd4194d0fbb9e5df2fcfeab5d5b69a28218e9

See more details on using hashes here.

File details

Details for the file uharfbuzz-0.4.0-cp36-cp36m-macosx_10_6_x86_64.whl.

File metadata

  • Download URL: uharfbuzz-0.4.0-cp36-cp36m-macosx_10_6_x86_64.whl
  • Upload date:
  • Size: 371.7 kB
  • Tags: CPython 3.6m, macOS 10.6+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/2.7.15

File hashes

Hashes for uharfbuzz-0.4.0-cp36-cp36m-macosx_10_6_x86_64.whl
Algorithm Hash digest
SHA256 b1a64fd6a270f666813efed0635facdbbce15b68556c7784d89cd4bffe02eb9e
MD5 5f90d538738ddf8dfdfdaa37e9fd4e1c
BLAKE2b-256 0a9086be84f5d4132a7528576c50bbb0a8087baa42c39977192dfc7a77d90c16

See more details on using hashes here.

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