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.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
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.3.0.zip
(18.1 kB
view hashes)
Built Distributions
uharfbuzz-0.3.0-cp37-cp37m-win32.whl
(222.8 kB
view hashes)
uharfbuzz-0.3.0-cp36-cp36m-win32.whl
(222.9 kB
view hashes)
Close
Hashes for uharfbuzz-0.3.0-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a4810e59b1f67c59a5a4eebf3738a901cded5d4aa38cfd5903e00d07afd62463 |
|
MD5 | a00c76b3bde9143d57e5e7fe276018bd |
|
BLAKE2b-256 | 14e2a3dd455655c5ac39958c3308f52afb3b8cbdab622aea67bc56e751ba98d5 |
Close
Hashes for uharfbuzz-0.3.0-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 921758548cc3419a7bd0efd87fe5f6ff479fd6b40f7427a74cfc4ecccf64cad5 |
|
MD5 | 007066647bb3ed6bceb6750177d01d64 |
|
BLAKE2b-256 | 18726e9c5ab9b4f1d902d06aa0f80126746342895b549c0e558d2530547fe0f2 |
Close
Hashes for uharfbuzz-0.3.0-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | edf53f310672f050a84578cc8d2c444907bc4e1255f948d254c774dd14da90b9 |
|
MD5 | 18dfe0445f315702be4a17e60a00eff4 |
|
BLAKE2b-256 | 17e627a7f154048712db3388e4b0964275475522145873e70217072ff57a136e |
Close
Hashes for uharfbuzz-0.3.0-cp37-cp37m-macosx_10_6_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 98ad886e2cc3f152a262d08ad4dfe4c59e50f37fd6d5db485c1cea2c0949622a |
|
MD5 | dac664c6c589e20dd690c3ba6867a922 |
|
BLAKE2b-256 | 4b5957997c6e3939b0ba7c259ecb9bfd0c7afd8da348707d24e4a3fe1a7beaf9 |
Close
Hashes for uharfbuzz-0.3.0-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 18eac13e16c0c3477b34aafb57e9ab024c1dc025794391b61b4e9ee99a31f243 |
|
MD5 | bfb0bead65c0c0f1395639aaaf1afc6d |
|
BLAKE2b-256 | ad58b4dfc22d1b0f0886a0235e004cd5f853a195c33f6070077de8f55b936efd |
Close
Hashes for uharfbuzz-0.3.0-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3386f2bca8aabb8a66cd1abb96b359fd9d3dd96440c577f1987a34c802346152 |
|
MD5 | 3313d97d5014bef19b88fb504b103eed |
|
BLAKE2b-256 | a660761bb9334492fa3e57daeac909b18468507c2e10bc5984e03b431243f776 |
Close
Hashes for uharfbuzz-0.3.0-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | be05e30cbfc39a421ae0161b97065f240bf4a7d061dd37c12c1ea4dfcb8d8e6a |
|
MD5 | 2846ca12cef9772c3a5a47bd4fdc3750 |
|
BLAKE2b-256 | aef05b2ea2a655543930ec70b9f1fcb1df6630b1826c6c4372fb0a41f801fcb8 |
Close
Hashes for uharfbuzz-0.3.0-cp36-cp36m-macosx_10_6_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9ce17b44b6ccfdebe27c19fe8fb03161c37088f82a1cdc44a43f58a8ec15b515 |
|
MD5 | e39e63c3629b816db69e32be3aa969d8 |
|
BLAKE2b-256 | b12f46e5ea36795cd7c4ef56a3189f14fc39b0b814e6a1482515252a1056cdb2 |