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.2.zip
(17.9 kB
view hashes)
Built Distributions
uharfbuzz-0.2.2-cp37-cp37m-win32.whl
(186.9 kB
view hashes)
uharfbuzz-0.2.2-cp36-cp36m-win32.whl
(187.2 kB
view hashes)
Close
Hashes for uharfbuzz-0.2.2-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 338a41e4b305728712e5c14ae23c3ebd23ef03e31bc41482153bd7c41496f325 |
|
MD5 | 6272494cc96ac9c8b8819dc20a4164d4 |
|
BLAKE2b-256 | ab858512b1b5a507e44ccdeabaa9701529dd5b766d6b59fb491df3c9d7267cf9 |
Close
Hashes for uharfbuzz-0.2.2-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0a3f2cf4f3409d164f09fc382d501aa3609ca50b7c62a05f6d3fac499dcf2ece |
|
MD5 | ba1f8e00a5b8cbf5c14f4a35ae13054e |
|
BLAKE2b-256 | b79fe179d795a36e09aba03acd124813ddc74c56446036d776e0b4b31dda9b13 |
Close
Hashes for uharfbuzz-0.2.2-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 043993f24a23044f71413fbbf5707cf0a7d7b107420620f1c9d9ba8958d776ca |
|
MD5 | e3b2172280d9f8d1b49c8fe82ccb8f10 |
|
BLAKE2b-256 | c1bc1894ffa029d951f69184a70cc810536a4a869bf6ffeb2e47e971c5de156f |
Close
Hashes for uharfbuzz-0.2.2-cp37-cp37m-macosx_10_6_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 05a3ffa66c60d7e42f6eb6f06d889d150beedc6b828cb03a4280ce3e280eadce |
|
MD5 | ba75e9ea7c04ec51aa7bf166207bb6fd |
|
BLAKE2b-256 | 555f86d9d1eb8b9c2bc83759c9e8ad621a834ee60541e14930e5230297e5bdb5 |
Close
Hashes for uharfbuzz-0.2.2-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d91aa02e2cf1d6970c07e4ff490ca063767f2b74356cc49856764fc74f22e05e |
|
MD5 | dc355d7616ed667a1d52d7b202829938 |
|
BLAKE2b-256 | 6590c5bb0e946cc0c19261faa6411f4816e25b85557563547ce21cfcbe3fe46f |
Close
Hashes for uharfbuzz-0.2.2-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8d154f4d784e7e12e7f73abd2be03df19f07b7138cf03e238927e32a6fa6c4d1 |
|
MD5 | 1aa5dcc87867bdb58a5dec52a365b261 |
|
BLAKE2b-256 | 5f0a7cea0c90b26574489c9a1bf06b6bdbc8774178075aca1885fb5917e22975 |
Close
Hashes for uharfbuzz-0.2.2-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 586ee9ef99081da63382e70eb1adedad4a821a5c8880d6db46dfb7e7b98f4f30 |
|
MD5 | 934c18017f6b4424e967562bbc395266 |
|
BLAKE2b-256 | 051df8e4b6ebc3e13fc0bea0168afdefa1a0baf69ef5a56c64ea1f8a09426ece |
Close
Hashes for uharfbuzz-0.2.2-cp36-cp36m-macosx_10_6_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf8543a8a30676089e6060d0fc1d36ac63720772c5fc3a7c85d4cedc2851227c |
|
MD5 | e35ca0fccea31f42388d1bee2c420009 |
|
BLAKE2b-256 | 2ce05c857925f6af352593963d319161c0aac17d8aa58bf077c230356bc4df89 |