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.6.0.zip
(26.4 kB
view hashes)
Built Distributions
uharfbuzz-0.6.0-cp38-cp38-win32.whl
(259.4 kB
view hashes)
uharfbuzz-0.6.0-cp37-cp37m-win32.whl
(258.6 kB
view hashes)
uharfbuzz-0.6.0-cp36-cp36m-win32.whl
(258.8 kB
view hashes)
Close
Hashes for uharfbuzz-0.6.0-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 46c9c09b57d8d7fa9a78abd86889be29e84a9616d4b022505ef261ad9788e869 |
|
MD5 | b3e7e8c583929254785c5ce85b0601a3 |
|
BLAKE2b-256 | d56c3c3de2dc5b3819a42dc9769842b23afe847ba5a749c5657b4fd33eae26f1 |
Close
Hashes for uharfbuzz-0.6.0-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 12e65d9c6d3d59b4d2c1745681b247e5811746161126a292599a7a235a9ef333 |
|
MD5 | ad5149d6166cbd3d3276665dc1676395 |
|
BLAKE2b-256 | daa5b031e31248b71109f9e42ba2a44235fba874fcf2f2682963857ff128e2a0 |
Close
Hashes for uharfbuzz-0.6.0-cp38-cp38-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 28dbdfa1e33462ebdcf921b06cb45300f11177109d19f0a8f7cf70e56b15af99 |
|
MD5 | 1eee669f44c5cc0c30f41d48e2ae2628 |
|
BLAKE2b-256 | e712cbdf539165de1c727d420b0ce743110fde7d1aeb0608aefa793aa0632239 |
Close
Hashes for uharfbuzz-0.6.0-cp38-cp38-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 63e799a2b7e83e54b9dde5aa3fa71fa60cc1efdf1f08463d5262d00fa8fea958 |
|
MD5 | 7381c28681c3681604c7f3c4612adb73 |
|
BLAKE2b-256 | 87e872e3758009ac3cf279451f04d099a369c52da795bf27a54d21284f0a8258 |
Close
Hashes for uharfbuzz-0.6.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 749ca97bfbd0b1172b43bdaacdd6c8e8f16b9b10433ba5532b64c8c228e2b926 |
|
MD5 | 2209b2952e2f42ae00dd9854a54337f1 |
|
BLAKE2b-256 | a8b7f4d3e4f1aab35ccfaac10a13f6e2d554acea0f4d121b3a22db9af04ef35d |
Close
Hashes for uharfbuzz-0.6.0-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | abeddb6a00ee016bbaae00a5b6ba242f0822c5090ad427e3b8389c831e99c09b |
|
MD5 | 4b9f620bbf7de6ec5877b507a740ead0 |
|
BLAKE2b-256 | 44b71433519359c39b409c68e761ad732d654f3ad08581ae0c6e8bcb09c9bd5b |
Close
Hashes for uharfbuzz-0.6.0-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6e7266a143a61d1ac61be106e81198289425593ecd3af8f94bf41be45b0e52a8 |
|
MD5 | b818d7183f1e8da8ee8954f44e89c998 |
|
BLAKE2b-256 | f9bfd14329f3faa3c4747f0fe64cb1a02742c8f62f1e3752889b4876f4a9b7dd |
Close
Hashes for uharfbuzz-0.6.0-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 99233a5438c0d7c375546dcb8265f9ec8494929a3a719a38bd2186eab95898d2 |
|
MD5 | 956282f8ce9ec51e7b5133dbd0c57cc2 |
|
BLAKE2b-256 | 7d136e6d6b197fac7a6727d84d4b3ed9f769a5fd216842ac8c469f5b1f6e524f |
Close
Hashes for uharfbuzz-0.6.0-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8cba9537ea723f6fa4dbd06cba4facdd7576371e5321e21bb1055fd67b2e3668 |
|
MD5 | be893459677230829139d829fa9357be |
|
BLAKE2b-256 | a10c7ee4a96cde47136c5c7a71344eb2cd19ede53258315708fcbbc31219b661 |
Close
Hashes for uharfbuzz-0.6.0-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c6275a51c5a5d217aa3f28cd0d79baee6f1ec36578197796458f1b49e83e521b |
|
MD5 | aec253480c0e80656f3eebe8ea0ca664 |
|
BLAKE2b-256 | 1536da421138b49cc3b1aa364821a1e8684fd6de0ddd8f5f53330ad7b52f888f |
Close
Hashes for uharfbuzz-0.6.0-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c3d18cd5d5a30847e173c0008e7add4f2bbe48d6e8cb8bea06869ef7a21c7f95 |
|
MD5 | 7629c09055fcc511468457fae2f49ea6 |
|
BLAKE2b-256 | d78205c61c5c2546b1613b738bfd203c91916408a0936ffbcec90624c20aad9c |
Close
Hashes for uharfbuzz-0.6.0-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9450502f21910dac8ae6f4290818b6afdb5b11fbc58026e5b1e73d0a11fafb36 |
|
MD5 | 352b6b5f9239b52f4aaa75b43a115e4d |
|
BLAKE2b-256 | f91d030b6af14d8c5cfb4f27eba86a17b6d3db72042980ae1b2e8068aa681958 |
Close
Hashes for uharfbuzz-0.6.0-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f96af799c8be1dda9663621ebc6ae7044969b23ebc887054e145c7f996a0a18c |
|
MD5 | 214ec42ecf32f9204924bae34c299e62 |
|
BLAKE2b-256 | ad1c1214ea47179a9d99dcc56d4ce8650ec7dab64b954230621af33afb5c7027 |
Close
Hashes for uharfbuzz-0.6.0-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e3f40d1ad3ba222a7b29d84710904fead5dd0e3fc94c11eecd882c0e6e54770 |
|
MD5 | aaf26fe58ba830f7fe0daba6a29e7ea2 |
|
BLAKE2b-256 | a0de20afb69e57553a58aa9ee193215141d75ff6dffeca6421fd8c3a369c9ad8 |
Close
Hashes for uharfbuzz-0.6.0-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c4c6b049ad3af81448a1571d7342413c30abc139ca94acfcf3f0e7ad41834416 |
|
MD5 | 1373a9bf774e6ef747a775fa90e30899 |
|
BLAKE2b-256 | c1fc084118107797974613cc2571e92d227fc4e12c96c98ce84c6c08b931e0da |