Streamlined Cython bindings for the harfbuzz shaping engine
Project description
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.9.0.zip
(28.8 kB
view hashes)
Built Distributions
uharfbuzz-0.9.0-cp38-cp38-win32.whl
(266.8 kB
view hashes)
uharfbuzz-0.9.0-cp37-cp37m-win32.whl
(265.9 kB
view hashes)
uharfbuzz-0.9.0-cp36-cp36m-win32.whl
(266.1 kB
view hashes)
Close
Hashes for uharfbuzz-0.9.0-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4b12ccb4cce0ac10531afe3e30b6956ac0fe7e4dd5f83993d194466a8fccec4a |
|
MD5 | f6d70a80884c9120f3e22dcae1a481f4 |
|
BLAKE2b-256 | 424ac4a050fed58dacb3e0704ac710ea07c1dec977ee8eb2f4e6752a6a21def5 |
Close
Hashes for uharfbuzz-0.9.0-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b180200a12833bcdd35becb5427891ebef7fe621761b449860022258c2533051 |
|
MD5 | 30677c88a520a038c9b4bd111c8832d7 |
|
BLAKE2b-256 | a70fb34c1b7c899797ef4076478a0f45976537e695b338df172229660965c26b |
Close
Hashes for uharfbuzz-0.9.0-cp38-cp38-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b379c49faf627b968f26a94e04dd8a1ee2308490b3cdd1d74cce0add8171f89e |
|
MD5 | 108b02d90b5460a4adf6e30e308937e4 |
|
BLAKE2b-256 | bbc48c43e014698d77accd5d0998fd7686a8eb9d026c514aca9737b9ab4eb467 |
Close
Hashes for uharfbuzz-0.9.0-cp38-cp38-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 98ebf93fc73cc841c02dad8326ce397a927f6e0050e6b9330d505b2a70f7f342 |
|
MD5 | 7ef3def489baf857b1c5b0cec5d47271 |
|
BLAKE2b-256 | b7a9db22f7c3b70f14f858168bacd5f8d6a6415d05165e15834d1477c7f15b50 |
Close
Hashes for uharfbuzz-0.9.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fb15e9b7d351cea2ec0b835ce558e15f0cfb20be9e6e2c8dd59eb5c9530dda1d |
|
MD5 | f2f13b73154fec95643dfcabf8970852 |
|
BLAKE2b-256 | db2cb5aed3127433bed3dc5cc210d6dd6e70ab825c0271cb598f40c29454794d |
Close
Hashes for uharfbuzz-0.9.0-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dc3cd89bb3bf0042ea0caaaa1abaa32991dbf6ea1923858b2fa27ed5be9971cd |
|
MD5 | 77ddffa41d186c4632ae6553bb53bfc5 |
|
BLAKE2b-256 | 84a5d52a72a37ba0a250f957158efd281b4a86e469433b252a3c53af9a430089 |
Close
Hashes for uharfbuzz-0.9.0-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 117c78eb15f86ccfd633862f5e6999d16b55b73d50dbd263b16c5c06337aea3e |
|
MD5 | 24bd3a15c486860daa276c981b1a3eaa |
|
BLAKE2b-256 | a7cb0994bdda8419681da3864a55203995a9031552fd5cf889c6ba55672a8dbd |
Close
Hashes for uharfbuzz-0.9.0-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7cd5e0a3b1d5ca72fae34efcf18802853ab3d816f0a867c2e568507c175d5af6 |
|
MD5 | d4ca3d7190b2aa088a24b7426da91ddc |
|
BLAKE2b-256 | 6f024b45dc3119c49f353df2d2469c03cfdf52aa8d4e3b0f077e650d21a42f9c |
Close
Hashes for uharfbuzz-0.9.0-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8ba2d72925cb09d5112a7dda111a73663f107ac6d005710aa9cfdf846f3b9834 |
|
MD5 | 7c8f7759288810d33b339487f193ea53 |
|
BLAKE2b-256 | 7d07e3ceb5c3d7f48aa30aa1d769a30603ee5a8dd51d38d6dcf5c106aa663181 |
Close
Hashes for uharfbuzz-0.9.0-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 12f19aa456efab5d803662876840e95b163ea948fcb9431d5e03b90a0e284968 |
|
MD5 | 5ff841cab00b11453ef916b98514f67f |
|
BLAKE2b-256 | 8ed4a31f166e93046cb10fe0264d14456acd6058eb66bbf2200968603e36ff99 |
Close
Hashes for uharfbuzz-0.9.0-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c64364b0aacb14a1194e7aa0275fca7bf3946b3d471216d4b3e981289cff90ac |
|
MD5 | 001138988040100d42c41ba9be43db90 |
|
BLAKE2b-256 | 7eb105993a92b54837588c64c3b22367eb1e7c5a22b56599f9b54d1ea96b3ef5 |
Close
Hashes for uharfbuzz-0.9.0-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a4967780375f03a20118e697565b7a9014e783c68dc7cd621feec00d14e26dd8 |
|
MD5 | 9e9d011fd54f7ff264badd14d0baf1d0 |
|
BLAKE2b-256 | fd749b8704e408c8716cb81796493a592c2fadbb51fc061024f66309fe833afa |
Close
Hashes for uharfbuzz-0.9.0-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bea0dc1009b6d6c92220986f7b361e741a00a78f65ab57f72784a1004972bcc8 |
|
MD5 | ebe4ca692e1fc0a86a2eeea379ad09f5 |
|
BLAKE2b-256 | aeaf286d92d7d35eb2a5169636bf69ca4812086d8ce43956c7f6864812461af8 |
Close
Hashes for uharfbuzz-0.9.0-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9f0e89d845a1b8b7b59ffc0adfd4649d44dae4191a637d1ac93b2cd9d8a47b80 |
|
MD5 | c3da60ea9ce9c2757356d9449b27273e |
|
BLAKE2b-256 | ec1f910688e2aab0e272424b69345e676d4deb47a9d12490f05a35ee8c968da8 |
Close
Hashes for uharfbuzz-0.9.0-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 83fc50a9c52a736ec81b305c3142e47f0656b894e6554d181eca80dd0ab99296 |
|
MD5 | ad71befbb9ed2de9ce2a0c307b27a426 |
|
BLAKE2b-256 | ad4d8962891bd7d18134d4aeede8825b29c7e57ab95b6fcea25f83bacec808b6 |