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)
Python version of PlaceNL's headless bot with automatic access token refresh

Reddit /r/place 2022 headless bot This headless Python bot will automatically login to reddit, obtain access tokens (and refreshes them when they expi

19 May 21, 2022
A Python API For Questionnaire

Инструкция по разворачиванию приложения Окружение проекта: python 3.8 Django 2.2.10 djangorestframework Склонируйте репозиторий с помощью git: git clo

2 Feb 14, 2022
Verkehrsunfälle in Deutschland, aufgeschlüsselt nach Verkehrsmittel des Hauptverursachers und Nebenverursachers

How-To Einfach ./main.py ausführen mit der Statistik-Datei aus dem Ordner "Unfälle_mit_mehreren_Beteiligten" als erstem Argument. Requirements python,

4 Oct 12, 2022
Discord Streaming Statut (Bot/SelfBot)

Discord-Streaming-Status Discord Streaming Status For Both User Accounts And Bot Accounts. Open your cmd and enter the command: pip install discord BE

Komuro 2 Nov 02, 2021
a discord libary that use to make discord bot with low efficiency and bad performance because I don't know how to manage the project

Aircord 🛩️ a discord libary that use to make discord bot with low efficiency and bad performance because I don't know how to manage the project Examp

Aircord 2 Oct 24, 2021
This is a simple bot that can be used to upload images to a third-party cloud (image hosting). Currently, only the imgbb.com website supports the bot. I Will do future updates

TGImageHosting This is a simple bot that can be used to upload images to a third party cloud (image hosting). Currently, only the imgbb.com website su

Abhijith N T 0 Dec 26, 2021
A python client for the Software-Challenge Germany.

sc-client-python A python client for the Software-Challenge Germany. Creating a new project (Optional) Install virtualenv virtualenv is a tool that cr

rpkak 3 Jan 22, 2022
Botto - A discord bot written in python that uses the hikari and lightbulb modules to make this bot

❓ About Botto Hi! This is botto, a discord bot written in python that uses the h

3 Sep 13, 2022
thumbor is an open-source photo thumbnail service by globo.com

Survey If you use thumbor, please take 1 minute and answer this survey? It's only 2 questions and one is multiple choice!!! thumbor is a smart imaging

Thumbor (by @globocom) 9.3k Dec 31, 2022
A collection of scripts to steal BTC from Lightning Network enabled custodial services. Only for educational purpose! Share your findings only when design flaws are fixed.

Lightning Network Fee Siphoning Attack LN-fee-siphoning is a collection of scripts to subtract BTC from Lightning Network enabled custodial services b

Reckless_Satoshi 14 Oct 15, 2022
A Discord Self bot written in python

WitheredBot A Discord Self bot written in python Requirement Python = 3.9 How to Configure git clone https://github.com/a-a-a-aa/WitheredBot.git cd W

......... 0 Jan 05, 2023
Python On WhatsApp - Run your python codes on whatsapp along with talking to a chatbot

Python On WhatsApp Run your python codes on whatsapp along with talking to a chatbot This is a small python project to run python on whatsapp. and i c

Prajjwal Pathak 32 Dec 30, 2022
TwitterDataStreaming - Twitter data streaming using APIs

Twitter_Data_Streaming Twitter data streaming using APIs Use Case 1: Streaming r

Rita Kushwaha 1 Jan 21, 2022
Changes the Telegram bio, profile picture, first and last name to the song that the user is currently listening to.

TGBIOFY - Telegram & Spotify integration Changes the Telegram bio, profile picture, first and last name to the song that the user is currently listeni

elpideus 26 Dec 07, 2022
Clipboard-watcher - Keep an eye on the apps that are using your clipboard

clipboard-watcher This repository contains the code of an experiment, in order t

Gonçalo Valério 48 Oct 13, 2022
OpenSea-Python-Bot - OpenSea Python Bot can be used in 2 modes

OpenSea-Python-Bot OpenSea Python Bot can be used in 2 modes. When --nft paramet

49 Feb 10, 2022
DoriBot -Discord Chat Bot

DoriBot -Discord Chat Bot Please do not use these source files for commercial use. Be sure to mark the source. 이제 더이상의 메이저 업데이트는 없습니다. 마이너 업데이트들은 존재합니

queenanna1999 0 Mar 30, 2022
WhatsApp API Python ChatBot

WhatsApp Api Python - Esta documentação tem como objetivo exemplificar o uso do Moorse Whatsapp API na linguagem Python.

Douglas Alves 2 Jan 06, 2022
A Pythonic client for the official https://data.gov.gr API.

pydatagovgr An unofficial Pythonic client for the official data.gov.gr API. Aims to be an easy, intuitive and out-of-the-box way to: find data publish

Ilias Antonopoulos 40 Nov 10, 2022
Polars-fun - Example notebooks for how to use pola.rs

polars-fun Polars is an awesome Rust DataFrame library with Python language bindings. This repo makes it easy to run Polars code on your local machine

Matthew Powers 2 Jun 28, 2022