Skip to main content

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 details)

Uploaded Source

Built Distributions

ufostroker-0.3.0-cp37-abi3-manylinux_2_34_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.34+ x86-64

ufostroker-0.3.0-cp37-abi3-macosx_11_0_arm64.whl (276.4 kB view details)

Uploaded CPython 3.7+ macOS 11.0+ ARM64

ufostroker-0.3.0-cp37-abi3-macosx_10_12_x86_64.whl (283.0 kB view details)

Uploaded CPython 3.7+ macOS 10.12+ x86-64

File details

Details for the file ufostroker-0.3.0.tar.gz.

File metadata

  • Download URL: ufostroker-0.3.0.tar.gz
  • Upload date:
  • Size: 18.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.18

File hashes

Hashes for ufostroker-0.3.0.tar.gz
Algorithm Hash digest
SHA256 c1f8026c9c42b65543818f81b6ef0ec7f12a03b45cddbde91296722e4120b7ac
MD5 9d749e0b25462c5ac861f2e8095dd95a
BLAKE2b-256 fb5802c0fd65a9d515e1e442fca0d5abd761067a71f5959245af21392cea488b

See more details on using hashes here.

File details

Details for the file ufostroker-0.3.0-cp37-abi3-manylinux_2_34_x86_64.whl.

File metadata

  • Download URL: ufostroker-0.3.0-cp37-abi3-manylinux_2_34_x86_64.whl
  • Upload date:
  • Size: 1.9 MB
  • Tags: CPython 3.7+, manylinux: glibc 2.34+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.18

File hashes

Hashes for ufostroker-0.3.0-cp37-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 bffa0afeebf5bcbc9ba3d7af986d28b82adc4542fe71b62fec187b96d080f52d
MD5 fc3fc016bb63d76b3d786785419e1c2b
BLAKE2b-256 1fd20d3a17aa8da3168e82d27e098364f743cf8b0b33c03da6ea6ba26553e7a6

See more details on using hashes here.

File details

Details for the file ufostroker-0.3.0-cp37-abi3-macosx_11_0_arm64.whl.

File metadata

  • Download URL: ufostroker-0.3.0-cp37-abi3-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 276.4 kB
  • Tags: CPython 3.7+, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.18

File hashes

Hashes for ufostroker-0.3.0-cp37-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 91e00c1f265d5000ae4e3a0f5f65f373389fd1cc3aac6bf850842eac9ff65574
MD5 2d89871abbe9e634035a5dabe9ba5819
BLAKE2b-256 0eec6df047c0bc9f21eac08adbbecf023c54f79e93e7ab9ad94684237c9ca993

See more details on using hashes here.

File details

Details for the file ufostroker-0.3.0-cp37-abi3-macosx_10_12_x86_64.whl.

File metadata

  • Download URL: ufostroker-0.3.0-cp37-abi3-macosx_10_12_x86_64.whl
  • Upload date:
  • Size: 283.0 kB
  • Tags: CPython 3.7+, macOS 10.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.18

File hashes

Hashes for ufostroker-0.3.0-cp37-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 b84eb7fb97885e4d7be2f94761a4e4e62f50efab99c6cceb2b5bdf10f7fbcc3a
MD5 c8be2f5d485f17cb0f6f440c420289a8
BLAKE2b-256 2fecf99d0da67dbfa1af0dec6fd7030478d36dd818ca015562c3a3f45e0dfa1c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page