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.create(fontdata)
font = hb.Font.create(face)
upem = face.upem

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

buf = hb.Buffer.create()

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

This version

0.2.2

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.2.2.zip (17.9 kB view details)

Uploaded Source

Built Distributions

uharfbuzz-0.2.2-cp37-cp37m-win_amd64.whl (214.4 kB view details)

Uploaded CPython 3.7m Windows x86-64

uharfbuzz-0.2.2-cp37-cp37m-win32.whl (186.9 kB view details)

Uploaded CPython 3.7m Windows x86

uharfbuzz-0.2.2-cp37-cp37m-manylinux1_x86_64.whl (341.2 kB view details)

Uploaded CPython 3.7m

uharfbuzz-0.2.2-cp37-cp37m-macosx_10_6_x86_64.whl (302.0 kB view details)

Uploaded CPython 3.7m macOS 10.6+ x86-64

uharfbuzz-0.2.2-cp36-cp36m-win_amd64.whl (214.5 kB view details)

Uploaded CPython 3.6m Windows x86-64

uharfbuzz-0.2.2-cp36-cp36m-win32.whl (187.2 kB view details)

Uploaded CPython 3.6m Windows x86

uharfbuzz-0.2.2-cp36-cp36m-manylinux1_x86_64.whl (341.6 kB view details)

Uploaded CPython 3.6m

uharfbuzz-0.2.2-cp36-cp36m-macosx_10_6_x86_64.whl (302.3 kB view details)

Uploaded CPython 3.6m macOS 10.6+ x86-64

File details

Details for the file uharfbuzz-0.2.2.zip.

File metadata

  • Download URL: uharfbuzz-0.2.2.zip
  • Upload date:
  • Size: 17.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/2.7.15

File hashes

Hashes for uharfbuzz-0.2.2.zip
Algorithm Hash digest
SHA256 a72cdc382609d45faaf4ab0ef59415d5b2c3ccf7f5a4270c1a0f7eb293f2ef93
MD5 996366c278320ca419a59d612d60a89c
BLAKE2b-256 1f0dfe71ad5e248621a7857c73b1e6c2ce749f18df413cd29bc447b790b65f55

See more details on using hashes here.

File details

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

File metadata

  • Download URL: uharfbuzz-0.2.2-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 214.4 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.19.1 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/2.7.15

File hashes

Hashes for uharfbuzz-0.2.2-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 338a41e4b305728712e5c14ae23c3ebd23ef03e31bc41482153bd7c41496f325
MD5 6272494cc96ac9c8b8819dc20a4164d4
BLAKE2b-256 ab858512b1b5a507e44ccdeabaa9701529dd5b766d6b59fb491df3c9d7267cf9

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for uharfbuzz-0.2.2-cp37-cp37m-win32.whl
Algorithm Hash digest
SHA256 0a3f2cf4f3409d164f09fc382d501aa3609ca50b7c62a05f6d3fac499dcf2ece
MD5 ba1f8e00a5b8cbf5c14f4a35ae13054e
BLAKE2b-256 b79fe179d795a36e09aba03acd124813ddc74c56446036d776e0b4b31dda9b13

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for uharfbuzz-0.2.2-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 043993f24a23044f71413fbbf5707cf0a7d7b107420620f1c9d9ba8958d776ca
MD5 e3b2172280d9f8d1b49c8fe82ccb8f10
BLAKE2b-256 c1bc1894ffa029d951f69184a70cc810536a4a869bf6ffeb2e47e971c5de156f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: uharfbuzz-0.2.2-cp37-cp37m-macosx_10_6_x86_64.whl
  • Upload date:
  • Size: 302.0 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.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/2.7.15

File hashes

Hashes for uharfbuzz-0.2.2-cp37-cp37m-macosx_10_6_x86_64.whl
Algorithm Hash digest
SHA256 05a3ffa66c60d7e42f6eb6f06d889d150beedc6b828cb03a4280ce3e280eadce
MD5 ba75e9ea7c04ec51aa7bf166207bb6fd
BLAKE2b-256 555f86d9d1eb8b9c2bc83759c9e8ad621a834ee60541e14930e5230297e5bdb5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: uharfbuzz-0.2.2-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 214.5 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.19.1 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/2.7.15

File hashes

Hashes for uharfbuzz-0.2.2-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 d91aa02e2cf1d6970c07e4ff490ca063767f2b74356cc49856764fc74f22e05e
MD5 dc355d7616ed667a1d52d7b202829938
BLAKE2b-256 6590c5bb0e946cc0c19261faa6411f4816e25b85557563547ce21cfcbe3fe46f

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for uharfbuzz-0.2.2-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 8d154f4d784e7e12e7f73abd2be03df19f07b7138cf03e238927e32a6fa6c4d1
MD5 1aa5dcc87867bdb58a5dec52a365b261
BLAKE2b-256 5f0a7cea0c90b26574489c9a1bf06b6bdbc8774178075aca1885fb5917e22975

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for uharfbuzz-0.2.2-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 586ee9ef99081da63382e70eb1adedad4a821a5c8880d6db46dfb7e7b98f4f30
MD5 934c18017f6b4424e967562bbc395266
BLAKE2b-256 051df8e4b6ebc3e13fc0bea0168afdefa1a0baf69ef5a56c64ea1f8a09426ece

See more details on using hashes here.

File details

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

File metadata

  • Download URL: uharfbuzz-0.2.2-cp36-cp36m-macosx_10_6_x86_64.whl
  • Upload date:
  • Size: 302.3 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.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/2.7.15

File hashes

Hashes for uharfbuzz-0.2.2-cp36-cp36m-macosx_10_6_x86_64.whl
Algorithm Hash digest
SHA256 cf8543a8a30676089e6060d0fc1d36ac63720772c5fc3a7c85d4cedc2851227c
MD5 e35ca0fccea31f42388d1bee2c420009
BLAKE2b-256 2ce05c857925f6af352593963d319161c0aac17d8aa58bf077c230356bc4df89

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