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.5.0.zip
(25.7 kB
view hashes)
Built Distributions
uharfbuzz-0.5.0-cp37-cp37m-win32.whl
(254.5 kB
view hashes)
uharfbuzz-0.5.0-cp36-cp36m-win32.whl
(254.9 kB
view hashes)
Close
Hashes for uharfbuzz-0.5.0-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fc4cace0261e0cbd9cc818766c5f18047ba2a85caf4d03917e158e6dc01ae222 |
|
MD5 | 6fbeeb35f069718ff8e8cff882bcebf9 |
|
BLAKE2b-256 | 65833c7dc1118042691c946a80048d9e68f704340051754934c489b16429046a |
Close
Hashes for uharfbuzz-0.5.0-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bb420c6ca54f43a86b303d3e75a9e7343335ec12a5758e296963487f85fc7bbd |
|
MD5 | b93dcf619c58916b3e7d6637820dcb5a |
|
BLAKE2b-256 | 8bab81304d1a187c7bed9374511fe8eb847c91d689e21d61d434de45fc733442 |
Close
Hashes for uharfbuzz-0.5.0-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e8a46d7fd6434adbca2094ebde6a49cb0070e109f045ce4e4c83237c15088d25 |
|
MD5 | 51fe658fe49a91d02f83f73afb35bf6e |
|
BLAKE2b-256 | adb7e89368ff56c97773e193078036995b7269cb20694ed3a8f6baa4f5b9a62f |
Close
Hashes for uharfbuzz-0.5.0-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 933fbe051ab0dea3ed5762ed29e320fbb1af4fbbf6be46290184905547b0eaeb |
|
MD5 | 4337cb4e7e4175645fe831f4d5b0ebd3 |
|
BLAKE2b-256 | f7abdc62e1361d63fcbf1691d11f32fe4cb69f24ac5f605a676c9a89b640a9d7 |
Close
Hashes for uharfbuzz-0.5.0-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 94ca848b5982430d01fb6daca38128992f5c17a8c429f5924f59e12f61646fa0 |
|
MD5 | f21cf0333a55316b7456638d41aa2a75 |
|
BLAKE2b-256 | 8f095f8583e652bc7c5a962c51af3b161bd4beaa9369e3d470ae7b6b04b5b00d |
Close
Hashes for uharfbuzz-0.5.0-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bedb1611a3d1baa56a9b24f2bb895b477cdd0a0d6875fad6a5b258d266e97690 |
|
MD5 | d369bb77565531799a405160a4df7afc |
|
BLAKE2b-256 | e335558e5f5a311c54b9c631d30f66e500bd9ee484597d389ee5f0a191f6aae6 |
Close
Hashes for uharfbuzz-0.5.0-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0dd99110321a3e3ee9a77375a4947bbe31943ee9cbfb9980e7d29cd33ec8ebda |
|
MD5 | 0c1c00495fac98fc1e22c9e0bea66161 |
|
BLAKE2b-256 | 746f2b1c999b895b67cd54e4b6e6d387629b0c02024f1c8a0bfe83802ce1c41e |
Close
Hashes for uharfbuzz-0.5.0-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eccc5902241aa71b53b4899c0c062104201c675b5d9e6b4609c0ad7aa0af6ecb |
|
MD5 | 42fad62555e5fa3f5604698df51fb10b |
|
BLAKE2b-256 | ad77e5a8646a7131cef73a7add8d2d80d354e62af5637c81418fade401dc514d |