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.4.0.zip
(24.8 kB
view hashes)
Built Distributions
uharfbuzz-0.4.0-cp37-cp37m-win32.whl
(227.7 kB
view hashes)
uharfbuzz-0.4.0-cp36-cp36m-win32.whl
(227.5 kB
view hashes)
Close
Hashes for uharfbuzz-0.4.0-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 179e7aa48a4f904c6506d51c57e4973e1c076b09598b96b163f789fc4eac88d5 |
|
MD5 | 545000aae63f8d9308e9f53dd3f781b5 |
|
BLAKE2b-256 | b5d9f31239ca19be24ce56e382c0d70d62954d12ab0147cfb92ac86702b87ebd |
Close
Hashes for uharfbuzz-0.4.0-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 61bdb29eab3f7ed0b7213534007486616ef02d5a11873c3ad8d7f8718a01aea9 |
|
MD5 | 8d31587b8e35de97fdc8f270ea0174d0 |
|
BLAKE2b-256 | 599271dc53f31bb7e552893c948d15d3d19503a2e30865f792b8fe5e38c50d06 |
Close
Hashes for uharfbuzz-0.4.0-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 92ca68bb2f52fc1e94566e3cec16eaebdbeb29ef21b850fe14176cb70d4230f8 |
|
MD5 | 93502b78455cb55a11feb50473c48642 |
|
BLAKE2b-256 | a5c0e3580eb68816ef222cc8286c254b1e8f2c3c386e27b24e81d2b8b7734e42 |
Close
Hashes for uharfbuzz-0.4.0-cp37-cp37m-macosx_10_6_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 45ab9f0e0df86394bb6ce3f58b5900c23b1562b917122db3bfc8271a97bca3af |
|
MD5 | 29f922a0169d2152ba84557d6101629a |
|
BLAKE2b-256 | 9949d8da29d150318860d485b0059e8c54c4e66e625fcc226fc924aa4b7314c0 |
Close
Hashes for uharfbuzz-0.4.0-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6c7b74a541ec7a84fd63c04adafc3d57f880865d2cbd1e57937e43353486daa9 |
|
MD5 | 5de82446445007fd494588b1f9278f1d |
|
BLAKE2b-256 | 22a12f3dd7a7836f90049eb8bfffac3c0a00ef6b1c6eba314737b0342aaf36d5 |
Close
Hashes for uharfbuzz-0.4.0-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d08028365b99674b5ce16e21706a79b862e9554606547b72c0d633b49ced22fb |
|
MD5 | 8cea33bbaf36ca0982954342e468b968 |
|
BLAKE2b-256 | ba16559ec71e1981ee57888e0d95591bae3f23aeb69f5e089e770d70e9ddbf6a |
Close
Hashes for uharfbuzz-0.4.0-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1aeae0e7d05ff00d220d3263327ff7ae15e6c2fb59df818152347285d2819cc4 |
|
MD5 | 9183fa46224a56b8cb416d5838817cb0 |
|
BLAKE2b-256 | 91ac3aaf8a2f61d95ee10b65063fd4194d0fbb9e5df2fcfeab5d5b69a28218e9 |
Close
Hashes for uharfbuzz-0.4.0-cp36-cp36m-macosx_10_6_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b1a64fd6a270f666813efed0635facdbbce15b68556c7784d89cd4bffe02eb9e |
|
MD5 | 5f90d538738ddf8dfdfdaa37e9fd4e1c |
|
BLAKE2b-256 | 0a9086be84f5d4132a7528576c50bbb0a8087baa42c39977192dfc7a77d90c16 |