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.12.0.zip
(29.8 kB
view hashes)
Built Distributions
uharfbuzz-0.12.0-cp38-cp38-win32.whl
(273.4 kB
view hashes)
uharfbuzz-0.12.0-cp37-cp37m-win32.whl
(271.6 kB
view hashes)
uharfbuzz-0.12.0-cp36-cp36m-win32.whl
(271.7 kB
view hashes)
Close
Hashes for uharfbuzz-0.12.0-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 598ed283b6df54c7a492833cbb45ffc9d10ef377f9dd920a4d5ed0188df43700 |
|
MD5 | 3c53b6d07c2c9f5920acb4b9898886a8 |
|
BLAKE2b-256 | 16d4a5dabd16439a1aa02a7694d0208314a882f223e195058c7fba51c56bb371 |
Close
Hashes for uharfbuzz-0.12.0-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c5f42bbe3620fe37ebca12ad4efb7eacd4acc89eacf584116228421501c2f228 |
|
MD5 | 3281520df64c1c52dec3a64705d29d21 |
|
BLAKE2b-256 | b29c913b493c3d9efaa5d9f3fd9c79bcd4bebea97fb244a53d9522524018ea8f |
Close
Hashes for uharfbuzz-0.12.0-cp38-cp38-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e4c62c8b653c74cc531e2cc95e1faf2ad3dec87fad3cdb6fbfb62f78a30241dc |
|
MD5 | 9db757b6f8474c3aaf35a48aa2413045 |
|
BLAKE2b-256 | 66d982356aaf534fb3aa3ea5d1bdbd8145c43e95cc9cf791ba9544fdb3ec5a40 |
Close
Hashes for uharfbuzz-0.12.0-cp38-cp38-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2ed92937e20d7792b9a1a084ba00bf30d8fdd5efb49c08d85619b2c1552db542 |
|
MD5 | 9135c63da1076c7fb06e117e49b34b4b |
|
BLAKE2b-256 | 86bfbc8de953d4b5be43d1118895b6762863dfe812b6e1b8e962fbcb01474b16 |
Close
Hashes for uharfbuzz-0.12.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aada1bd10779def69be596e5ce14f9764f4c977e320915bbf8fd354483005aec |
|
MD5 | 699325237cdb501502cc8093b995a348 |
|
BLAKE2b-256 | 8c8b911fb8100cb6c9c3d6cee280196863e7acd69cecd21cb7089c67482dd48e |
Close
Hashes for uharfbuzz-0.12.0-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 388c36d09fe5154e797df589b13f926e5f51cd08d5895db0acde5f8068059b85 |
|
MD5 | 503d2082679c9749c3f02c09a213daca |
|
BLAKE2b-256 | e2e852e582e3bf5bda8cbd86e9e77b95f3b60c0c2356d251be375077f4c2c9c8 |
Close
Hashes for uharfbuzz-0.12.0-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5fbb38fbd1289493062b19674272c6c3521886af1ce880d7bfabd7f8c3c06e6d |
|
MD5 | c605d416782431c994c44d766eb2b134 |
|
BLAKE2b-256 | deb860c30c2beef2a57fdb42200db08582e334a88ee6dbee5be4ec557bd5fdf3 |
Close
Hashes for uharfbuzz-0.12.0-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6eb4bb380c38312f80675770a31e50eb6c3b93369777cdef8e9957bc294baa8f |
|
MD5 | 0f50cf2f8a4d2607504c3e50e787764b |
|
BLAKE2b-256 | 9f347c11257a9b764f902b7d71a24a818187a6b8b4c8ac57b829ef6b36ee7354 |
Close
Hashes for uharfbuzz-0.12.0-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a1fc73d0f290fd55fdbc152d72dfdc2c4018dab37b0564fed9317120a7293652 |
|
MD5 | 260eb79f23708d38b8527eb7b87dde47 |
|
BLAKE2b-256 | a4ac3bd6e8c872206e1f87bc64e3cf69b1dfc4ecab2d536baa6f802a2b793cbf |
Close
Hashes for uharfbuzz-0.12.0-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8c53c595cefa57fff445da0a9dbd30b1402dc009e1e442bda759b2262c54d737 |
|
MD5 | 664e3ecc448efbb81fff873df9aa7726 |
|
BLAKE2b-256 | 9cca31c737530b2e0d1830526106b6f5188c44aa65be1cebd77b7d92ccc17cb8 |
Close
Hashes for uharfbuzz-0.12.0-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6ba81212f43faf122175af45ec4a7989fa7e67a62b396a5723e32cd21779200f |
|
MD5 | 400293029ae7498f67c70a669877cedc |
|
BLAKE2b-256 | 538580c6f3a28b0665998bbc617827936f7284cece25a126071457cd37246d14 |
Close
Hashes for uharfbuzz-0.12.0-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f26056ef57fe00844f2f886fdb8893862f43b9807b76a98758942b2bbfd0b756 |
|
MD5 | 6cbd77f9e741bf538ebe6a0ada87a91c |
|
BLAKE2b-256 | 9e6ad48f802302dc576fa56cc0c9747b3ebf88384c1c38bd6efb03a683d822b7 |
Close
Hashes for uharfbuzz-0.12.0-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b8bcb8b76442be84644e8e538aa3cbfb10ce93c9037e162038cf9d4f8d2f9611 |
|
MD5 | 64f565c05e1debbcff708ae125b8e832 |
|
BLAKE2b-256 | 6216f1b3ecc688a5571c8444d2d232990182ca1948f33f28d2fe3a31c9dbc9c4 |
Close
Hashes for uharfbuzz-0.12.0-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d670e7a0997713d503535befdabe6c64fc4cce0d86836874260790089de87882 |
|
MD5 | 5de42d186e39f6d6299c09c4572064a5 |
|
BLAKE2b-256 | febb06695836e54c158545af18d9591c7905a730f68afc3b60519830868b17cc |
Close
Hashes for uharfbuzz-0.12.0-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0791693c44f94cedb5b33bc35774e92d5561462f6cdda7ca5bc41e1ebf1f6040 |
|
MD5 | 1dce599deed8bbfe1039b4774feea02f |
|
BLAKE2b-256 | 3de94c6b24d676888bb4a448c9a726d4cb848e46f7e8cdf99ee5f4a4d3723d26 |