TypeRig is a Python library aimed at simplifying the current FontLab API

Overview

TR Core TR GUI GitHub last commit

TypeRig

TypeRig is a Python library aimed at simplifying the current FontLab API while offering some additional functionality that is heavily biased towards a simultaneous multi-layered workflow. As TypeRig (TR) is under rapid development in the last couple of years, please do update frequently.

Important note

If you are experiencing any trouble running your scripts after April 2021 please refer to our latest Py2.7 release. It is a snapshot before switching the TR core to Py3+ and refactoring most scripts to be both Py2.7 and Py3+ compatible.

Documentation

Please refer to the following work in progress document.

Known issues

Please refer to our issues tracker.

Releases

Please take a look at our latest releases.

Installation

FontLab 7 - Manual installation from GitHub

Download the archived (.zip) package provided from this repository or clone it. Run FontLab 7 and drag the installation file provided in the root folder caleld install.vfpy to the application (as if it was a font). The Output window should report if the installation was successful. The TypeRig library should now be installed.

If you want to install the GUI based part of Typerig (only after successfully installing the core library) please open FonLab, Scripting panel. At the bottom of the panel you will see a small black Plus sign (+). Click on it and FontLab will ask you to Select directory where your scripts reside. Point the app towards ./Scripts/Delta Machine and ./Scripts/GUI.

FontLab 7 - Automatic installation within the application

Run FontLab 7, choose Scripts > Update / Install Scripts. Click OK in the dialog, wait until the installation completes. When you see the TypeRig is up-to-date dialog, click OK and restart FontLab 7.

The Scripts menu should now show the Delta Machine and TypeRig GUI sub-menus.

Developer

TypeRig FDK is developed by: Vassil Kateliev (2017-2021) and Adam Twardoch (2019-2020)

For contact and inquiries: vassil(at)kateliev(dot)com

www.typerig.com

Comments
  • Cannot import name pFont

    Cannot import name pFont

    Fresh Windows & FontLab 7 installation, installed TypeRig via Scripts > Update/Install, restarted, and failed to run a script:

    from typerig.proxy import pFont
    
    cannot import name pFont
    

    What am I missing?

    opened by hyvyys 9
  • TypeRig panel screws up appearance of some FLVI UI controls

    TypeRig panel screws up appearance of some FLVI UI controls

    Hello Vassil,

    I don’t know where this problem exists (wheter it’s PythonQt or TypeRig or something else), but before I run TypeRig panel on macOS, my panel menus look like this:

    scr- 2019-08-26 at 00 34 05

    But when I run TypeRig panel, they change to:

    scr- 2019-08-26 at 00 35 17

    Is it possible that you do something in TypeRig that sets some styling of the TypeRig panel? (Which could then also influence the styling of some UI elements within FL). Because if you don’t customize anything, then it’ll be problem on some other end.

    Thanks!

    Bug 
    opened by twardoch 8
  • pGlyph > Layer Mark Issue

    pGlyph > Layer Mark Issue

    Vassil, please take a look at this line:

    https://github.com/kateliev/TypeRig/blob/74a486c80116105116711004f64018ff6d3b3116/Lib/typerig/proxy/fl/objects/glyph.py#L171

    I think it must be replaced by

    self.layer(layer).mark = mark_color

    to make the code work. Try to set a layer-specific flag with the method, and you will get an error. Thank you for looking into this.

    opened by alex-phil 5
  • Cannot import name QtGui

    Cannot import name QtGui

    For a while, I am unable to open TypeRig Panel, I get the following error:

    Traceback (most recent call last):
      File "C:/Users/Adam/Documents/FontLab/FontLab 7/Scripts/TypeRig GUI/typerig-panel.py", line 24, in <module>
        import Panel 
      File "C:/Users/Adam/Documents/FontLab/FontLab 7/Scripts/TypeRig GUI\Panel\__init__.py", line 19, in <module>
        __import__(module, locals(), globals())
      File "C:/Users/Adam/Documents/FontLab/FontLab 7/Scripts/TypeRig GUI\Panel\String.py", line 38, in <module>
        from typerig import QtGui
    ImportError: cannot import name QtGui
    

    Lacking a better idea, and having noticed that a script that does work for me (Metrics) imports from typerig.gui and not typerig, I changed from typerig import QtGui to from typerig.gui import QtGui, then I got

    Traceback (most recent call last):
      File "C:/Users/Adam/Documents/FontLab/FontLab 7/Scripts/TypeRig GUI/typerig-panel.py", line 24, in <module>
        import Panel 
      File "C:/Users/Adam/Documents/FontLab/FontLab 7/Scripts/TypeRig GUI\Panel\__init__.py", line 19, in <module>
        __import__(module, locals(), globals())
      File "C:/Users/Adam/Documents/FontLab/FontLab 7/Scripts/TypeRig GUI\Panel\String.py", line 40, in <module>
        from typerig.string import stringGen, stringGenPairs, strRepDict, fillerList, baseGlyphset
    ImportError: No module named string
    

    I'm on Windows btw.

    opened by hyvyys 5
  • Correct Connetions

    Correct Connetions

    Hello, there was this feature back in FL5 - copy from manual: Contour > Correct Connections to automatically fix incorrect sharp connections, that is sharp connections that can be turned into smooth connections without any change in the shape of the contour.

    This is exactly what I need to do now, but I cannot find anything like that in FL7 - is there perhaps such a feature in the Typerig somewhere?

    I don't wan any other Clean-up/Harmonize/Blance - just this simple task - please see attached (correct on top) image

    opened by Wirdek 5
  • pGlyph() > dereference() removes components

    pGlyph() > dereference() removes components

    Vassil, please take a look at these lines of code that are part of the dereference() function:

    https://github.com/kateliev/TypeRig/blob/85cf3dc59aa5ed7ec42cbd5501f7bbb332a68bae/Lib/typerig/proxy/fl/objects/glyph.py#L330-L335

    To my understanding, dereferencing an element reference is the same as what Element > Element Reference > Unlink Reference does. If that is correct, your function does too much. It not only unlinks element references, but also removes components. Which is clear from your code:

    1. You collect all element references of the specified glyph layer in a list ('only_shapes').
    2. You create a clone (unlinked equivalent) of each of these references and collect these clones in a list ('clones').
    3. You remove not only element references, but also components (and groups) from the glyph layer and only add the clones back in.

    This way, components (and groups) are removed from the specified glyph layer. Therefore, I think you should replace

    for clone in clones: wLayer.addShape(clone)
    

    by the following:

    for item in components + clones:
      wLayer.addShape(item)
    

    This way, components are also added back in. Would that make sense?

    opened by alex-phil 4
  • pGlyph > Mask Issue

    pGlyph > Mask Issue

    Vassil, please take a look at the following lines:

    https://github.com/kateliev/TypeRig/blob/3fbab884eb8ac28e69440dfe7249f65f543ee0bd/Lib/typerig/proxy/fl/objects/glyph.py#L266-L267

    Suppose you have a glyph with layers Regular and mask.Regular having layer indices 1 and 0 respectively. Then you will see that

    pGlyph().mask(layer=0)
    

    refers to the Regular layer and not to mask.Regular. More generally, if the layer index of a mask layer is used as the value of the keyword argument layer, the function will yield the parent layer of the mask layer, not the mask layer itself. But that is probably not intended, as the description of your function says “Returns mask layer no matter the reference.”

    To quickly check the behavior of the function in the described situation:

    from typerig.proxy.fl.objects.glyph import *
    print(pGlyph().mask(layer=0).name)
    

    Thank you for taking a look.

    opened by alex-phil 4
  • `pGlyph.anchors()` returns `flPinPoint`s instead of `flAnchor`s

    `pGlyph.anchors()` returns `flPinPoint`s instead of `flAnchor`s

    I'm trying to clear anchor expressions in all masters. But pGlyph.anchors() returns flPinPoints (which I have no idea how to edit) and not flAnchors as promised.

    from typerig.proxy import pFont
    
    font = pFont()
    
    for glyph in font.selected_pGlyphs():
      for layer in glyph.masters():
        for a in glyph.anchors(layer.name):
          print a 
          # <flPinPoint x=360 y=0 objectName='bottom' objectId=0x20623d04510>
          # ...
          # flPinPoint, not flAnchor!
          
          print a.x
          # 'flPinPoint' object has no attribute 'x'
    
    opened by hyvyys 4
  • Selecting Panel gives error code

    Selecting Panel gives error code

    Using FL7 7.1.4.7515. Others load fine. Error: Traceback (most recent call last): File "/Users/georgethompson/Library/Application Support/FontLab/FontLab 7/Scripts/TypeRig GUI/typerig-panel.py", line 23, in import Panel File "/Users/georgethompson/Library/Application Support/FontLab/FontLab 7/Scripts/TypeRig GUI/Panel/init.py", line 19, in import(module, locals(), globals()) File "/Users/georgethompson/Library/Application Support/FontLab/FontLab 7/Scripts/TypeRig GUI/Panel/TextBock.py", line 14, in from typerig import QtGui ImportError: cannot import name QtGui

    George

    opened by bodonibdoy 4
  • How to run a script across multiple glyphs?

    How to run a script across multiple glyphs?

    Hello Vassil, how do I run a Fontlab script, in the way it modify several selected glyphs at once? So far it seems to affect just the one "current/active", lastly selected glyph only, even when multiple glyphs are selected in "Font tab" window.

    Otherwise, this script was was kindly provided by you - thanks again, it has helped me a lot! :)

    #FLM: Sort Contours from typerig.proxy import pFont, pGlyph sort_by_y = True # Put False here if you want them to be X sorted glyph = pGlyph() for shape in glyph.shapes(): shape.contours = sorted(shape.contours, key=lambda c:c.bounds[sort_by_y]) glyph.updateObject(glyph.fl)

    Note: I'm no expert in scripting. Please help, Vit

    opened by Wirdek 4
  • Making TypeRig panels fit vertically into a MacBook Pro screen

    Making TypeRig panels fit vertically into a MacBook Pro screen

    This addresses https://github.com/kateliev/TypeRig/issues/17

    The result is a very compact appearance on the Mac — but everything fits:

    scr- 2019-08-26 at 04 10 47

    It’s implemented via a new typerig.QtGui module which acts as an adapter of the standard QtGui classes. Currently, it’s not very sophisticated — could be improved. But it’s better than the ugly hack with loading Fusion styling.

    Bug 
    opened by twardoch 4
  • Delta [Panel] Redesign

    Delta [Panel] Redesign

    To do:

    • use repurposed Delta Tuner version as the new Delta Panel (auto axis setup, auto layer change detection, auto glyph change);
    • use entirely new GUI heavily relying on icons;
    • do fixes and refactoring;
    Panel GUI 
    opened by kateliev 0
  • Delta machine not scaling metrics and anchors...

    Delta machine not scaling metrics and anchors...

    Possible .service_array bug reported by @etunni. Delta machine (delta panel) not always scaling metrics and anchors. Observed is only LSB change? To investigate further...

    Bug Panel 
    opened by kateliev 6
  • Connecting QAction signals to custom slots

    Connecting QAction signals to custom slots

    This code adds signals to each main menu item that prints the object name and the mouse cursor position. It shows how you can attach signals to QActions.

    opened by twardoch 0
Releases(v2.0.5-Py3.10)
  • v2.0.5-Py3.10(Dec 20, 2022)

  • v2.0.0-Py3.10(Jun 28, 2022)

  • v1.9.0-Py2.7(Feb 22, 2022)

    The latest known version of TypeRig EOF (End of Life) release that is fully working and compatible with both Py2.7 (FontLab 7) and Py3.10 (FontLab 8). You should get this release if you have scripts that worked up to February 2022, but not after.

    Source code(tar.gz)
    Source code(zip)
  • v1.5.0-py27(Apr 6, 2021)

    The latest TypeRig EOF (End of Life) release using Python 2.7 core and scripts. From v.1.5 forward only minor bugs will be fixed. This release is:

    • a snapshot of TR as it was, before officially switching to Python 3+ core code and 2.7 & 3+ compatible GUI scripts;
    • keeping backwards compatibility for projects that require it where their scripts were not updated to some newer version;
    • for FontLab 6 and 7 (up to version 7.2).

    You should get this release if you have scripts that worked up to April 2021, but not after.

    Source code(tar.gz)
    Source code(zip)
A simple Discord bot that can fetch definitions and post them in chat.

A simple Discord bot that can fetch definitions and post them in chat. If you are connected to a voice channel, the bot will also read out the definition to you.

Tycho Bellers 4 Sep 29, 2022
A Discord bot that enables using breakout rooms on a server

Discord Breakout Room Bot This bot enables you to use breakout rooms on your Discord server! Note This bot was thrown together within a few hours, so

Till Müller 2 Nov 23, 2021
IdeasBot - Funny telegram bot to generate ideas for a project

Repository of PIdeas_bot About Funny telegram bot for generating projects ideas.

Just Koala 5 Oct 16, 2022
A simple object model for the Notion SDK.

A simplified object model for the Notion SDK. This is loosely modeled after concepts found in SQLAlchemy.

Jason Heddings 54 Jan 02, 2023
A Telegram Music Bot with proper functions written in Python with Pyrogram and Py-Tgcalls.

⭐️ Yukki Music Bot ⭐️ A Telegram Music Bot written in Python using Pyrogram and Py-Tgcalls Ready to use method A Support Group and ready-to-use runnin

Shikhar Kumar 1000 Jan 03, 2023
Twitter bot that turns comment chains into ace attorney scenes. Inspired by and using https://github.com/micah5/ace-attorney-reddit-bot

Ace Attorney twitter Bot Twitter bot that turns comment chains into ace attorney scenes. Inspired by and using https://github.com/micah5/ace-attorney-

Luis Mayo Valbuena 542 Dec 17, 2022
Widevine MPD Content Downloader & Decryptor

Widevine-DL Encrypted MPD Manifest Content Downloader + Decryptor (not a Widevine Key Extractor!) Requirements ffmpeg, yt-dlp, aria2, widevine-l3-decr

Vank0n (SJJeon) 170 Dec 30, 2022
Companion "receiver" to matrix-appservice-webhooks for [matrix].

Matrix Webhook Receiver Companion "receiver" to matrix-appservice-webhooks for [matrix]. The purpose of this app is to listen for generic webhook mess

Kim Brose 13 Sep 29, 2022
A Telegram Bin Checker Bot made with python for check Bin valid or Invalid. 💳

Bin Checker Bot A Telegram Bin Checker Bot made with python for check Bin valid or Invalid. 📌 Deploy On Heroku 🏷 Environment Variables API_ID - Your

Chamindu Denuwan 20 Dec 10, 2022
Pogodasbot - Telegram bot sending channel weather info

Pogodasbot - Telegram bot sending channel weather info

Qayrat Sultan 1 Dec 15, 2022
Discord.py Bot Series With Python

Discord.py Bot Series YouTube Playlist: https://www.youtube.com/playlist?list=PL9nZZVP3OGOAx2S75YdBkrIbVpiSL5oc5 Installation pip install -r requireme

Step 1 Dec 17, 2021
This repository contains Python code examples using the MoneyMoov API

Python Examples This repository contains Python code examples using the MoneyMoov API. The examples are written to operate in the NoFrixion sandbox en

nofrixion 1 Feb 08, 2022
⛑ REDCap API interface in Python

REDCap API in Python Description Supports structured data extraction for REDCap projects. The API module d3b_redcap_api.redcap.REDCapStudy can be logi

D3b 1 Nov 21, 2022
Some random bot for Discord which was created just for fun (Made with Discord.py library)

Ghosty Previously known as 'secondthunder-py-bot' This is repository of some random bot for Discord which was created just for fun and for some educat

Владислав 8 Oct 02, 2022
Rotten Tomatoes API for Python

rottentomatoes.py rottentomatoes offers an easy-to-use Python wrapper to interact with the Rotten Tomatoes API. Before you try and use the API, make s

Zach Williams 88 Dec 15, 2022
A simple telegram bot to download from Zee5 links

Zee5 Downloader If you find any bugs, report at @TroJanzSupport My Features: 👉 Upload as file/video from any NON-DRM Zee5 link 👉 Permanent thumbnail

TroJanzHEX 95 Dec 20, 2022
Injector/automatic translator (using deepL API) for Tsukihime Remake

deepLuna Extractor/Editor/Translator/Injector for Tsukihime Remake About deepLuna, from "deepL", the machine translation service, and "Luna", the name

30 Dec 15, 2022
An advanced Filter Bot with nearly unlimitted filters!

Unlimited Filter Bot ㅤㅤㅤㅤㅤㅤㅤ ㅤㅤㅤㅤㅤㅤㅤ An advanced Filter Bot with nearly unlimitted filters! Features Nearly unlimited filters Supports all type of fil

1 Nov 20, 2021
🔍 Google Search unofficial API for Python with no external dependencies

Python Google Search API Unofficial Google Search API for Python. It uses web scraping in the background and is compatible with both Python 2 and 3. W

Avi Aryan 204 Dec 28, 2022
Forked from 0x36 on github who then rewrote the ida_kernelcache python framework

Forked from 0x36 on github who then rewrote the ida_kernelcache python framework. Sadly 0x36 doesn't seem to have push updates to the project and it took me a very long time to figure out why this wa

Turnerhackz1 6 Dec 13, 2022