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)
This software's intent is to automate all activities related to manage Axie Infinity Scholars. It is specially aimed to mangers with large scholar roasters.

Axie Scholars Utilities This software's intent is to automate all activities related to manage Scholars. It is specially aimed to mangers with large s

Ferran Marin 153 Nov 16, 2022
Visual Weather api. Returns beautiful pictures with the current weather.

VWapi Visual Weather api. Returns beautiful pictures with the current weather. Installation: sudo apt update -y && sudo apt upgrade -y sudo apt instal

Hotaru 33 Nov 13, 2022
Design and build a wrapper for the Open Weather API current weather data service

Design and build a wrapper for the Open Weather API current weather data service that returns a city's temperature, with caching, also allowing for the temperature of the latest queried cities that are still validly cached to be retrieved.

Duan Rafael Ribeiro 1 Jun 27, 2022
Spotify Top Lists - get the current top lists of a user from the Spotify API and display them in a Flask app

Spotify Top Lists This is a simple script that will get the current top lists of a user from the Spotify API and display them in a Flask app. Requirem

Yasin 0 Oct 16, 2022
A python script that changes our background based on current weather and time of the day.

Desktop background on Windows 10, based on current weather and time A python script that changes our background based on current weather and time of t

Maj Gaberšček 1 Nov 16, 2021
Discord bot that displays Jazz Jackrabbit 2 server status, current gamemode as "Playing.." status

JJ2-server-status-discord-bot Discord bot that displays Jazz Jackrabbit 2 server status, current gamemode as "Playing.." status How to setup: 0. Downl

null 2 Dec 9, 2021
Discord bot that displays the current Swatch Internet Time (.beat) as a status.

Internet-Time-Display Discord bot that displays the current Swatch Internet Time (.beat) as a status. Visit the website! Add the bot to your server! A

null 2 Mar 15, 2022
A simple program to display current playing from Spotify app on your desktop

WallSpot A simple program to display current playing from Spotify app on your desktop How to Use: Linux: Currently Supports GNOME and KDE. If you want

Nannan 4 Feb 19, 2022
Webb-Tracker-Bot - This is a discord bot that displays current progress of the James Webb Space Telescope.

Webb-Tracker-Bot - This is a discord bot that displays current progress of the James Webb Space Telescope.

Copperbotte 1 Jan 5, 2022
Texting service to receive current air quality conditions and maps, powered by AirNow, Twilio, and AWS

The Air Quality Bot is generally available by texting a zip code (and optionally the word "map") to (415) 212-4229. The bot will respond with the late

Alex Laird 8 Oct 16, 2022
alpaca-trade-api-python is a python library for the Alpaca Commission Free Trading API.

alpaca-trade-api-python is a python library for the Alpaca Commission Free Trading API. It allows rapid trading algo development easily, with support for both REST and streaming data interfaces

Alpaca 1.5k Jan 9, 2023
Beyonic API Python official client library simplified examples using Flask, Django and Fast API.

Beyonic API Python official client library simplified examples using Flask, Django and Fast API.

Harun Mbaabu Mwenda 46 Sep 1, 2022
Python API wrapper library for Convex Value API

convex-value-python Python API wrapper library for Convex Value API. Further Links: Convex Value homepage @ConvexValue on Twitter JB on Twitter Authen

Aaron DeVera 2 May 11, 2022
This an API wrapper library for the OpenSea API written in Python 3.

OpenSea NFT API Python 3 wrapper This an API wrapper library for the OpenSea API written in Python 3. The library provides a simplified interface to f

Attila Tóth 159 Dec 26, 2022
Aio-binance-library - Async library for connecting to the Binance API on Python

aio-binance-library Async library for connecting to the Binance API on Python Th

GRinvest 10 Nov 21, 2022
PRAW, an acronym for "Python Reddit API Wrapper", is a python package that allows for simple access to Reddit's API.

PRAW: The Python Reddit API Wrapper PRAW, an acronym for "Python Reddit API Wrapper", is a Python package that allows for simple access to Reddit's AP

Python Reddit API Wrapper Development 3k Dec 29, 2022
PRAW, an acronym for "Python Reddit API Wrapper", is a python package that allows for simple access to Reddit's API.

PRAW: The Python Reddit API Wrapper PRAW, an acronym for "Python Reddit API Wrapper", is a Python package that allows for simple access to Reddit's AP

Python Reddit API Wrapper Development 3k Dec 29, 2022
WhatsApp Api Python - This documentation aims to exemplify the use of Moorse Whatsapp API in Python

WhatsApp API Python ChatBot Este repositório contém uma aplicação que se utiliza

Moorse.io 3 Jan 8, 2022
Official python API for Phish.AI public and private API to detect zero-day phishing websites

phish-ai-api Summary Official python API for Phish.AI public and private API to detect zero-day phishing websites How it Works (TLDR) Essentially we h

Phish.AI 168 May 17, 2022