Skip to main content

Common routines for Fontforge plugins

Project description

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

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

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

fontforge_plugin_helper-0.2.0.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fontforge_plugin_helper-0.2.0-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file fontforge_plugin_helper-0.2.0.tar.gz.

File metadata

  • Download URL: fontforge_plugin_helper-0.2.0.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for fontforge_plugin_helper-0.2.0.tar.gz
Algorithm Hash digest
SHA256 09ecb43e3049fc2951ccb399892e0c2583f2f8005a539c0eff6e884e65969bbf
MD5 df87e25aa7447ce3a68464242abf543d
BLAKE2b-256 6237e7a40d2b83c76d3108d6d4d999f6b554f65cdf8d22b91d6f3c15038d6535

See more details on using hashes here.

Provenance

The following attestation bundles were made for fontforge_plugin_helper-0.2.0.tar.gz:

Publisher: python-publish.yml on MihailJP/fontforge-plugin-helper

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fontforge_plugin_helper-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for fontforge_plugin_helper-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e6e33aac188ded3e141966f1d7714acfec2d00c161346d97c032560666459349
MD5 bdaf56f1825acc66d5b1b467064a6df7
BLAKE2b-256 e8f6dca9c4c239749b4091e45edfa3a4b69a876ba2920d837c60e4aa397c4f85

See more details on using hashes here.

Provenance

The following attestation bundles were made for fontforge_plugin_helper-0.2.0-py3-none-any.whl:

Publisher: python-publish.yml on MihailJP/fontforge-plugin-helper

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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