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.zip
(25.8 kB
view hashes)
Built Distributions
Close
Hashes for uharfbuzz-0.5.1-cp38-cp38-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 55db5e5142322e1dc3cf6aca2a37898b2529c038cb4691ab7d36f01dde197786 |
|
MD5 | 82cfd7bcbf61794b0faa705f6d2711eb |
|
BLAKE2b-256 | 283923434f9f28c46730b1c88c686a78ceb31697340c22111de134603fabcc43 |
Close
Hashes for uharfbuzz-0.5.1-cp38-cp38-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7ee52935b5c927635a30752ae133a4c140b7d76b41b1de8aacdf1bc508c3e278 |
|
MD5 | ae8692e1586e2df0ffd7ff2f474087b0 |
|
BLAKE2b-256 | b52a4d03adbf27c486af08e287bb16b533aabc38aa17550455bb238da5d443e5 |
Close
Hashes for uharfbuzz-0.5.1-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 75c2944a5f85f2d2e48f654044cc06b52673000ddc01112022d76e7fd8a61c03 |
|
MD5 | c1ec5f11cf01cad65ab0901b3329c918 |
|
BLAKE2b-256 | 5e73929a9c58d787f70b1db2a6252a5f8dfdae5807bb67930e6b873b8cc1b2ec |
Close
Hashes for uharfbuzz-0.5.1-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ca927e79d695ab2c99ee466911c5193783e4f37ca9ac2c5e1233e1706752f893 |
|
MD5 | f945c3ed134b904d545c299aef4da6e2 |
|
BLAKE2b-256 | 96ef72bfbbb8d87b1315293e30b7a7eca3303f933d52e8295c9f99bb77dabcee |
Close
Hashes for uharfbuzz-0.5.1-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c1a9514d2751331acfff71a0bc10e3aa3626e14d1ac14340d03c0503161df09b |
|
MD5 | eb53c3cc92e0afe99e38c14af898ff31 |
|
BLAKE2b-256 | 950856dc2b90a15e19019cfdf52c1f83f53c54ee6cbeea7bfba928768b2dac1c |
Close
Hashes for uharfbuzz-0.5.1-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2839d2ce26963480d44b1c5aabb1552324c7e1f9bdce7f0402fd3d0f30335430 |
|
MD5 | a66ce654829f0d892c72dca3ac15e537 |
|
BLAKE2b-256 | 298ef60db9bc913dc67d013d92df9cb50d82b604ab92e2886f30cb3aeeb20ae8 |
Close
Hashes for uharfbuzz-0.5.1-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 450caf9920015b427687472b3078431c6a5b9e755e071155f78b8f91ea5f2399 |
|
MD5 | 242f9a072709f6dbb4d970df2c35ecfa |
|
BLAKE2b-256 | b196c017444d9ca0aba3a48b3050d29bf9eb589404a8c720e24be2ed3108d673 |
Close
Hashes for uharfbuzz-0.5.1-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0b6c610641345a4bc8fdcad21c456f7cf112fbbda143e5ad2639d78a87811e8d |
|
MD5 | 3408a60da6eef05f594d073b1e11e3d9 |
|
BLAKE2b-256 | e4a050da04e79b86e6f8eebcdb0e83aefd746fb0fe7f16600d9504d736bf3aa5 |
Close
Hashes for uharfbuzz-0.5.1-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 222ee5dbb21224d022906f3ce43b74f98a53f3dd431d2670b5fe89aa7820dfb6 |
|
MD5 | cd6e8686a2713c9d860d748d337c1753 |
|
BLAKE2b-256 | 9241eee70d614765986985a12953d9cb29a43c8f8ac7dc0c9e119a92dfb8ac25 |