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.1.post1.zip
(26.3 kB
view hashes)
Built Distributions
Close
Hashes for uharfbuzz-0.5.1.post1-cp38-cp38-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 53e052448d283087c76f34624e8875025d9d17205fbcfc27099e37ff47329051 |
|
MD5 | 8f9d6d04a67747c6ad20889fdb37172e |
|
BLAKE2b-256 | 2374e20bab14a5fa3b7564e1db475d06c53a57041ee0d620f6e2efeb32057108 |
Close
Hashes for uharfbuzz-0.5.1.post1-cp38-cp38-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b25964b33898a5d9fa86761ffbb38a59282cffd6c8eab7728ad55b2ac1cf3672 |
|
MD5 | bfafb2bfd07b9fc38bae437d062dfe70 |
|
BLAKE2b-256 | e79cce78b509d4fe22556183502206510a29098a4a9599311472c95567f5e819 |
Close
Hashes for uharfbuzz-0.5.1.post1-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 495b95df1acc9a4b24bb032ecfc2ab3c99a3e334ef408d188f22f7ed650aa316 |
|
MD5 | d09dae594ae62f50baa3b99bf9d7224f |
|
BLAKE2b-256 | 96953454a65f2735fe5b1e1d54b19bad2466021bfe98f785995d570d733d0dc6 |
Close
Hashes for uharfbuzz-0.5.1.post1-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aa412ca351aef613fb52dc03003727ba2ec87293f8dca5e3a026acd407a809c2 |
|
MD5 | 9d127856555b626036099de6faeba65b |
|
BLAKE2b-256 | 82a705800f4cd1176705ae88e38878e8dd291e6a4954fbc431c1661e5b72b0ea |
Close
Hashes for uharfbuzz-0.5.1.post1-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4ffaa2a7cfd67787a6a12fd5f5db5db4d53f1794e428f788058f201e9e24dd1d |
|
MD5 | f9ccd2faff0d44caf24b54e978d92bac |
|
BLAKE2b-256 | 3933ab10f85a1b3abd47213873d23f6c538ed7cc773084dc7dc177a8d3a329b7 |
Close
Hashes for uharfbuzz-0.5.1.post1-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4c5eaaecbede3db4dd34d2fc32feac3635499ba3a9c427d6461c10ff086b343c |
|
MD5 | 84d0c5dab7bd2aff2a724870984f07c3 |
|
BLAKE2b-256 | 95508d101df9f73312e8e8c5cb0194f04fe06ed318b51c4e6127cf6f7d790536 |
Close
Hashes for uharfbuzz-0.5.1.post1-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4d41f867b323da9f67bf322248a72ee61547193a90f84d8b681ee66ba30512f4 |
|
MD5 | 319956269297d09a5026a40f55823db0 |
|
BLAKE2b-256 | e57aff44f663d8b5b695dc4d234f46431439689f195e03f5b3ca848d2893440d |
Close
Hashes for uharfbuzz-0.5.1.post1-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 729d22218c7a16127acd4a2159cc16318160db4219acbc332cd2f45d9da0d969 |
|
MD5 | 319d20376d84f5bfb2fdf28e4b17e5c0 |
|
BLAKE2b-256 | 13e35d8aa04d3fcaac87e592c7beeb2d702ccaf8fc95f0a3d29c43c9c8291a75 |
Close
Hashes for uharfbuzz-0.5.1.post1-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a166243729f055c3e0653b264735715b8d661164d8ff09a2b0519508f68afc06 |
|
MD5 | 86d298a530d3fca140324848901a40be |
|
BLAKE2b-256 | 11d80308035ed47aea2f81764a16c4f21509ea0475b51f900c085663715dbbb4 |