Python wrapper around the MFEKmath library
Project description
ufostroker-py
This Python module wraps the Rust MFEK/math
library's capability for path stroking. It currently exports one function,
constant_width_stroke
:
from ufostroker import constant_width_stroke
f = ufoLib2.Font("tests/data/Scurve.ufo")
constant_width_stroke(f["A"], width=50, startcap="square", endcap="square")
This modifies the glyph in place. The library works with defcon and ufoLib2 objects.
This may also be used as a fontmake command line plugin:
fontmake --filter 'ufostroker::StrokeFilter(pre=True,Width=50)' -u OpenPaths.ufo -o ttf
Or by adding a lib key into the UFO file's lib.plist
file:
<key>com.github.googlei18n.ufo2ft.filters</key>
<array>
<dict>
<key>name</key>
<string>ufostroker.StrokeFilter</string>
<key>pre</key>
<true/>
<key>kwargs</key>
<dict>
<key>Width</key>
<integer>50</integer>
<key>StartCap</key>
<string>square</string>
<key>EndCap</key>
<string>square</string>
<key>JoinType</key>
<string>mitre</string>
<key>RemoveExternal</key>
<true/>
</dict>
</dict>
</array>
Building
Use maturin
to build ufostroker
.
pip3 install maturin
python3 -m venv strokervenv
. ./strokervenv/bin/activate
maturin develop
maturin build # Build wheel
License
Apache 2.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ufostroker-0.3.0.tar.gz
(18.1 kB
view hashes)
Built Distributions
Close
Hashes for ufostroker-0.3.0-cp37-abi3-manylinux_2_34_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bffa0afeebf5bcbc9ba3d7af986d28b82adc4542fe71b62fec187b96d080f52d |
|
MD5 | fc3fc016bb63d76b3d786785419e1c2b |
|
BLAKE2b-256 | 1fd20d3a17aa8da3168e82d27e098364f743cf8b0b33c03da6ea6ba26553e7a6 |
Close
Hashes for ufostroker-0.3.0-cp37-abi3-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 91e00c1f265d5000ae4e3a0f5f65f373389fd1cc3aac6bf850842eac9ff65574 |
|
MD5 | 2d89871abbe9e634035a5dabe9ba5819 |
|
BLAKE2b-256 | 0eec6df047c0bc9f21eac08adbbecf023c54f79e93e7ab9ad94684237c9ca993 |
Close
Hashes for ufostroker-0.3.0-cp37-abi3-macosx_10_12_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b84eb7fb97885e4d7be2f94761a4e4e62f50efab99c6cceb2b5bdf10f7fbcc3a |
|
MD5 | c8be2f5d485f17cb0f6f440c420289a8 |
|
BLAKE2b-256 | 2fecf99d0da67dbfa1af0dec6fd7030478d36dd818ca015562c3a3f45e0dfa1c |