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.1.zip
(17.7 kB
view hashes)
Built Distributions
uharfbuzz-0.2.1-cp37-cp37m-win32.whl
(189.2 kB
view hashes)
uharfbuzz-0.2.1-cp36-cp36m-win32.whl
(189.2 kB
view hashes)
Close
Hashes for uharfbuzz-0.2.1-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5338b6fc74389614c20f97e2e8f056314d29d1de9ee22d1ca5b39bc473494897 |
|
MD5 | b6606cd7374fe9ce3112ee3c2240b887 |
|
BLAKE2b-256 | d7241b88e36f6bcd1d4497b56622bc794bdb12c0902a5d7ad5ab2241a6089c3a |
Close
Hashes for uharfbuzz-0.2.1-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9fbb2314a8f6ddbdca8691c7670ac281fbcade975739e8889e0da95543158873 |
|
MD5 | ceb9e700ff87771f8be4cb30668a90d6 |
|
BLAKE2b-256 | 0ba17c564d335075d1564ac17b38acae6707ed0432664e1bf3051e36b11a2291 |
Close
Hashes for uharfbuzz-0.2.1-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 899ab470ce77f9ac14848af3ec3815d93b18745a71323b06ede5587bde804edc |
|
MD5 | 3198c4de3f58deb16faee0258b319b68 |
|
BLAKE2b-256 | 3b12259acc17769cfc9a39d4ff195713a9e0e3e4205ea0f5564eb0f63a75ed26 |
Close
Hashes for uharfbuzz-0.2.1-cp37-cp37m-macosx_10_6_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cea0d34a2da87baa97a24f8869e6133334563f2476e51c8024a97218c60ad1f0 |
|
MD5 | 3f73956ae6ad0b745d4760134d04990f |
|
BLAKE2b-256 | 04de88705eb7423e47171b41e1ba199cef2a3c15ee7847bfa1d257459f6e161c |
Close
Hashes for uharfbuzz-0.2.1-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1cae9dc4bef13d8f4534bef16ba086c41215f04c3e2f8cf18c128bc6f952079f |
|
MD5 | 6d0dc9374496b24b5e33a1bafe4e1fdc |
|
BLAKE2b-256 | 834a23d301c180b2ae6680d4a62dc484d08411f25da096576a4c560b11a3b5b8 |
Close
Hashes for uharfbuzz-0.2.1-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | caec180737f8fee30e91de0dbd762fe425388c2b237d6b326d7ade4ca54249b5 |
|
MD5 | 75f86c5524198aa3f84eef4c84e95025 |
|
BLAKE2b-256 | b17a9bc347f81cda64c8469356b0df883e62675a5fe8b5b6eace5bd6e88a8a9b |
Close
Hashes for uharfbuzz-0.2.1-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5c03ef81bb2f2b615db06c535ccb46fc10964c397500d56b9014e5800fab09c3 |
|
MD5 | f4f3c0b363eea604be7398091dfdffff |
|
BLAKE2b-256 | 5260b9f2877eecfb82e0edb595ceca3d939b8ff7b49840a185c5fe84242b658b |
Close
Hashes for uharfbuzz-0.2.1-cp36-cp36m-macosx_10_6_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0fe245c3d0991b2d660632f4a1662a272738515d44fd995cdcb3f2370ce3f695 |
|
MD5 | 55b7adf13a50fb2700eb1d36d3f85552 |
|
BLAKE2b-256 | f55696de42d1cdfdf1d7a8975c657e88c1746c67f5b578248fe02f060018b272 |