Skip to main content

Fontforge plugin helper

A collection of common routines for Fontforge plugins

This module is intended to be called from Fontforge plugins. This module itself is not a Fontforge plugin.

Install

pip3 install fontforge_plugin_helper

Usage

Bézier-related features

fontforge_plugin_helper.getInterpolatedCoord()

contour = font['A'].layers[1][0]
x, y = fontforge_plugin_helper.getInterpolatedCoord(contour, 1.5)

fontforge_plugin_helper.getTangentAngle()

contour = font['A'].layers[1][0]
tangentAngle = fontforge_plugin_helper.getTangentAngle(contour, 1.5)

Glyph name related features

fontforge_plugin_helper.escapeGlyphName()

filename = '{0}.svg'.format(fontforge_plugin_helper.escapeGlyphName('A'))

Hook-related features

fontforge_plugin_helper.addSystemHook()

def myNewFontHook(font):
    do_something


def myLoadFontHook(font):
    do_something


def fontforge_plugin_init(**kw):
    fontforge_plugin_helper.addSystemHook('newFontHook', myNewFontHook)
    fontforge_plugin_helper.addSystemHook('loadFontHook', myLoadFontHook)

fontforge_plugin_helper.addFontGenerateHook()

def myPreGenerationHook(font):
    do_something


def myPostGenerationHook(font):
    do_something


def myNewOrLoadFontHook(font):
    fontforge_plugin_helper.addFontGenerateHook(font,
                                                'generateFontPreHook',
                                                myPreGenerationHook)
    fontforge_plugin_helper.addFontGenerateHook(font,
                                                'generateFontPostHook',
                                                myPostGenerationHook)


def fontforge_plugin_init(**kw):
    fontforge_plugin_helper.addSystemHook('newFontHook', myNewOrLoadFontHook)
    fontforge_plugin_helper.addSystemHook('loadFontHook', myNewOrLoadFontHook)

fontforge_plugin_helper.generationHookSetter()

def myPreGenerationHook(font):
    do_something


def myPostGenerationHook(font):
    do_something


def fontforge_plugin_init(**kw):
    fontforge_plugin_helper.addSystemHook(
        'newFontHook',
        fontforge_plugin_helper.generationHookSetter(
            myPreGenerationHook,
            myPostGenerationHook,
        )
    )
    fontforge_plugin_helper.addSystemHook(
        'loadFontHook',
        fontforge_plugin_helper.generationHookSetter(
            myPreGenerationHook,
            None,  # if not needed
        )
    )

Translation-related features

class fontforge_plugin_helper.Translations

tr = fontforge_plugin_helper.Translations()

def spam(u, font):
    pass

def fontforge_plugin_init(**kw):
    tr.set('fr', '_Open', '_Ouvrir')
    tr.setTranslations('fr', {
        '_Open': '_Ouvrir',
        '_Close': '_Fermer',
        '_MyMenu': '_MonMenu',
    })
    tr.setTranslations('de', {
        '_Open': 'Ö_ffnen',
        '_Close': 'S_chließen',
        '_MyMenu': '_MeinMenü',
    })
    fontforge.registerMenuItem(
        callback=spam,
        context="Font",
        name=tr.get('_MyMenu')
    )

Metadata

Release files for fontforge-plugin-helper 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fontforge-plugin-helper 0.4.0
File Size Uploaded
fontforge_plugin_helper-0.4.0.tar.gz 11.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fontforge-plugin-helper 0.4.0
File Interpreter ABI Platform
fontforge_plugin_helper-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 19.6 kB

Release files / fontforge_plugin_helper-0.4.0.tar.gz

Download URL fontforge_plugin_helper-0.4.0.tar.gz
Size 11.0 kB
Tags Source
SHA-256 checksum
How to use checksums
2098134b674db45885a2bbe21970d1da8b5ac2967323658ef8a1139e8348fe35
BLAKE2b-256 checksum
How to use checksums
ee045a25b47c5d26fc49d72036f6e63e694e4c642377c2b0c397683ec319c084
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 6, 2026.

Transparency log

Release files / fontforge_plugin_helper-0.4.0-py3-none-any.whl

Download URL fontforge_plugin_helper-0.4.0-py3-none-any.whl
Size 8.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d6ffd28e1b146969101b84b3698bbc0b8e1ef060beda1321416ec35d10a85fc7
BLAKE2b-256 checksum
How to use checksums
1c19e425ecc7ffa097a6284e45812daaa50422b3e670d490e64879782f240e58
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 6, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page