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)
Terminal-Trade(Panel API) For Binance

Binance-Trade-Project Binance Futures Terminal-Trade(API) & Binance This Project Worth Around 500 Bucks. **I Did This Project For SomeOne And He

Cyber 9 Dec 30, 2021
A simple tool that lets you know when you are out of Lost Ark's queues

Overview A simple tool that lets you know when you are out of Lost Ark's queues. You can be notified via: Sound: the app will play a sound Discord web

Nelson 3 Feb 15, 2022
Python Client Library to interface with the Phoenix Realtime Server

supabase-realtime-client Python Client Library to interface with the Phoenix Realtime Server This is a fork of the supabase community realtime client

Anand 2 May 24, 2022
A Python library for miHoYo bbs and HoYoLAB Community

A Python library for miHoYo bbs and HoYoLAB Community. genshin 原神签到小助手

384 Jan 05, 2023
A file-based quote bot written in Python

Let's Write a Python Quote Bot! This repository will get you started with building a quote bot in Python. It's meant to be used along with the Learnin

1 Feb 23, 2022
Unofficial Python wrapper for official Hacker News API

haxor Unofficial Python wrapper for official Hacker News API. Installation pip install haxor Usage Import and initialization: from hackernews import H

147 Sep 18, 2022
Non official, but friendly QvaPay library for the Python language.

Python SDK for the QvaPay API Non official, but friendly QvaPay library for the Python language. Setup You can install this package by using the pip t

Carlos Lugones 17 Nov 25, 2022
Social Framework

Social Int Framework Social Int Framework its a Selenium script that scrape the IG photos and do a Reverse search on google and yandex for finding ano

29 Dec 06, 2022
A simple Python wrapper for the archive.is capturing service

archiveis A simple Python wrapper for the archive.is capturing service. Installation pipenv install archiveis Python Usage Import it. import archi

Ben Welsh 157 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
GUI Pancakeswap2 and Uniswap3 trading client (and bot)

GUI Pancakeswap2 and Uniswap3 trading client (and bot) (MOST ADVANCE TRADING BOT SUPPORT WINDOWS LINUX MAC) (AUTO BUY TOKEN ON LUNCH AFTER ADD LIQUIDI

16 Dec 23, 2021
A Python API for Connected 2

connected API for Connected 2 api for the { connected 2 } programmer : api report api follow api check username api forget password api Search api cha

2 Jun 05, 2022
AWS SDK for Python

Boto3 - The AWS SDK for Python Boto3 is the Amazon Web Services (AWS) Software Development Kit (SDK) for Python, which allows Python developers to wri

the boto project 7.8k Jan 08, 2023
An information scroller Twitter trends, news, weather for raspberry pi and Pimoroni Unicorn Hat Mini and Scroll Phat HD.

uticker An information scroller Twitter trends, news, weather for raspberry pi and Pimoroni Unicorn Hat Mini and Scroll Phat HD. Features include: Twi

Tansu Şenyurt 1 Nov 28, 2021
Tools to download and aggregate feeds of vaccination clinic location information in the United States.

vaccine-feed-ingest Pipeline for ingesting nationwide feeds of vaccine facilities. Contributing How to Configure your environment (instructions on the

Call the Shots 26 Aug 05, 2022
Python binding for Microsoft LightGBM

pyLightGBM: python binding for Microsoft LightGBM Features: Regression, Classification (binary, multi class) Feature importance (clf.feature_importanc

Ardalan 330 Nov 18, 2022
Bill is a bot capable to Chat with you, search everything on web to you, and send message to yours contacts for you.

Bill Bot The inteligent Bot Bill is a intelligent bot, it can chat, search and send messages to you. Chat with You Send messages on WhatsApp for you S

João Assalim 3 Sep 12, 2021
Poll-Bot Repo For Telegram #telegram

Intro This Is A Simple Bot To Create Poll In Channel and Groups And Also This Is our First Project Too.. Enter you tokens at these are very important

BotsUniverse 6 Oct 21, 2022
This bot will delete messages containing blacklisted words in your telegram groups.

Profanity Detector Bot This bot will delete messages containing blacklisted words in your telegram groups. Made using ProfanityDetector.

Aditya 17 Oct 08, 2022