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)
Repositorio dedicado a contener los archivos fuentes del bot de discord "Lector de Ejercicios".

Lector de Ejercicios Este bot de discord está pensado para usarse únicamente en el discord de la materia Algoritmos y Programación I, de la Facultad d

Franco Lighterman Reismann 3 Sep 17, 2022
Telegram bot for downloading covid-19 vaccine certificate

cowin-certificate-bot This is the source code of @cowincertbot, A telegram bot inspired by the whatsapp bot implementation of indian government for co

ArUn Pt 30 Oct 07, 2022
A simple worker for OpenClubhouse to sync data.

OpenClubhouse-Worker This is a simple worker for OpenClubhouse to sync CH channel data.

100 Dec 17, 2022
:lock: Python 2.7/3.X client for HashiCorp Vault

hvac HashiCorp Vault API client for Python 3.x Tested against the latest release, HEAD ref, and 3 previous minor versions (counting back from the late

hvac 1k Dec 29, 2022
Discord Bot for League of Legends live match tracker

SABot Dicord Bot for League of Legends match auto tracker Features: Search Summoners statistics in League of Legends. Auto-notifications provide when

Jungyu Choi 4 Sep 27, 2022
Official API documentation for Highrise

Highrise API The Highrise API is implemented as vanilla XML over HTTP using all four verbs (GET/POST/PUT/DELETE). Every resource, like Person, Deal, o

Basecamp 128 Dec 06, 2022
Diablo II Resurrected helper

Diablo II Resurrected 快捷施法辅助 功能: + 创建守护进程,注册全局热键 alt+/ 启用和关闭功能 (todo: 播放声音提示) + 按 x 强制移动 + 按 1 ~ 0 快捷施法到鼠标区域 使用 编辑配置 settings.py 技能信息做如下定义: SKILLS:

Wan 2 Nov 06, 2022
A fast and expressive Craigslist API wrapper

pycraigslist A fast and expressive Craigslist API wrapper. ⚠ As of September 2021, it is believed that Craigslist added a rate-limiter. It is advised

Ira Horecka 24 Dec 28, 2022
A Matrix-Instagram DM puppeting bridge

mautrix-instagram A Matrix-Instagram DM puppeting bridge. Documentation All setup and usage instructions are located on docs.mau.fi. Some quick links:

89 Dec 14, 2022
Fastest Tiktok Username checker on site.

Tiktok Username Checker Fastest Tiktok Username checker on site

sql 3 Jun 19, 2021
Send SMS text messages via email with as many accounts as you want :)

SMS-Spammer Send SMS text messages via email with as many accounts as you want :) Example Set Up Guide! To start log into the gmail account you would

Riceblades11 10 Oct 25, 2022
ZELDA USERBOT adalah userbot Telegram modular yang berjalan di Python3 dengan database sqlalchemy.

ZELDA USERBOT TELEGRAM Userbot Yang Di Buat Karena Sering Gabut Di Telegram. ZELDA USERBOT adalah userbot Telegram modular yang berjalan di Python3 de

1 Dec 23, 2021
Discord bot script for sending multiple media files to a discord channel according to discord limitations.

Discord Bulk Image Sending Bot Send bulk images to Discord channel. This is a bot script that will allow you to send multiple images to Discord channe

Nikola Arbov 1 Jan 13, 2022
A Telegram Music Bot written in Python using Pyrogram and Py-Tgcalls

A Telegram Music Bot written in Python using Pyrogram and Py-Tgcalls. This is Also The Source Code of The UserBot Which is Playing Music in @S1-BOTS Support Group ❤️

SAF ONE 224 Dec 28, 2022
Wakatime Response In javascript and python

Project Title Wakatime Response In javascript and python Description just for refrence Getting Started Dependencies For Python: requests json For Java

Gjenius20 1 Dec 31, 2021
A discord.py extension for sending, receiving and handling ui interactions in discord

discord-ui A discord.py extension for using discord ui/interaction features pip package ▪ read the docs ▪ examples Introduction This is a discord.py u

34 Dec 29, 2022
Vhook: A Discord webhook spammer / deleter open source coded by vesper

Vhook_Spammer Vhook is a advanced Discord webhook spammer / deleter with embeds,

Vesper 17 Nov 13, 2022
Boto3 code assistance for any API in any IDE, always up to date

botostubs Gives you code assistance for any boto3 API in any IDE. Get started by running pip install botostubs Demo Features PyPI package automaticall

Jeshan Giovanni BABOOA 94 Nov 14, 2022
A Python bot that uses the Reddit API to send users inspiring messages.

AnonBot By Edric Antoine A Python bot that uses the Reddit API to send users inspiring messages. When a message includes 'What would Anon do?', the bo

1 Jan 05, 2022
A command line interface for accessing google drive

Drive Cli Get the ability to access Google Drive without leaving your terminal. Inspiration Google Drive has become a vital part of our day to day lif

Chirag Shetty 538 Dec 12, 2022