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.2.0.zip
(17.6 kB
view hashes)
Built Distributions
uharfbuzz-0.2.0-cp37-cp37m-win32.whl
(189.2 kB
view hashes)
uharfbuzz-0.2.0-cp36-cp36m-win32.whl
(189.2 kB
view hashes)
Close
Hashes for uharfbuzz-0.2.0-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2af0bf64c2b8aebe513e4c35da5207ca85b515d8fbf01e1cde7fdcf9fb829bc8 |
|
MD5 | 026d59bff74c70aa0676e22cd83b04e8 |
|
BLAKE2b-256 | 2d74ddf51c26a766a8d86ddef8dda0897e53214a8889707726309c6511ac777b |
Close
Hashes for uharfbuzz-0.2.0-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7880bcb547482fd667fa33184c7ca88b6cf254de8ee0c1d5f75b38a62aaa8029 |
|
MD5 | 5f90f8c24ada0ecfc6801b0f9df2d3ab |
|
BLAKE2b-256 | 6cfcd25f4817b74dcb11b07beb80f36a6fc525443842e3b92d8c37d534375b6a |
Close
Hashes for uharfbuzz-0.2.0-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c0c8936ab421b8681fd7d43fc63d3aaa1f59503563e25167874471a4da1d9623 |
|
MD5 | f2aec44b42e51359d56165eaba0be278 |
|
BLAKE2b-256 | ee71d3a08d91f872a42b826754fd124eaa662a4708a8977f457ce2cbd1be2d32 |
Close
Hashes for uharfbuzz-0.2.0-cp37-cp37m-macosx_10_6_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3dd93fb1ce7fc71e5a455fd645bec785fdc42b8e6f885ebc8b80fb42acd12ad7 |
|
MD5 | c656f943ab218a2380abc2dc9f136788 |
|
BLAKE2b-256 | 701750496448d31ab91f44577b6ddb600f80a3b82443dc2094268bb890005d57 |
Close
Hashes for uharfbuzz-0.2.0-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fa3e4604226573d09f2b67be6f5cde8e117e06d82113edc595841a0857b64235 |
|
MD5 | 87c7d5ff3369165ac44c2a256597e31e |
|
BLAKE2b-256 | 5e988d92787b5a302b89be1f863f56c3e08347563c9632c7092a30cf265bf33f |
Close
Hashes for uharfbuzz-0.2.0-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1a252724bbf1ee98d34742f4eb011aa1f156a16e329c5ba60c7919bed26e2b63 |
|
MD5 | 876bb8f88282bc65d617583acc21687b |
|
BLAKE2b-256 | 8f17cb35a992fc1fa57cdd2781153479ddb42e5cd40c7889778f98fe5548e8be |
Close
Hashes for uharfbuzz-0.2.0-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 78e0d59da9b43fc8b11128cfffdedb925f480ab65c7c5e7ff23744d3dd914b38 |
|
MD5 | f42fe3a243f0bb7e14a356c9bde919da |
|
BLAKE2b-256 | 751c4422344c3f470f7cf264129a2976381f131e83fcba4b5d571d84a655135c |
Close
Hashes for uharfbuzz-0.2.0-cp36-cp36m-macosx_10_6_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 97cb07944c149f6f095a8002b50af2b6a682e1a9231a12a34290916850ed03fb |
|
MD5 | 4e33441e54f5026d7ce6039e9ac9cc4f |
|
BLAKE2b-256 | 52f80970a7797dd54a7377dadbd716d3c86733d575fba388f8eff3f7e6e8af31 |