kateliev / typerig Goto Github PK
View Code? Open in Web Editor NEWProxy API and Font Development Toolkit for FontLab
Home Page: https://kateliev.github.io/TypeRig/
License: BSD 3-Clause "New" or "Revised" License
Proxy API and Font Development Toolkit for FontLab
Home Page: https://kateliev.github.io/TypeRig/
License: BSD 3-Clause "New" or "Revised" License
Most of the stuff in layers panel could go into Contextual menus, so that it clears space for more advanced stuff.
Investigate Element grouping/un-grouping.
Enhance Elements panel so that it shows all elements in current (or all layers) and allows operations with them the same way as Layers panel does.
Modify existing TR Anchor panel so that it works with multiple glyphs or create TR Anchor Manager (as planned long ago)
Break contour extrapolation cannot exceed 25-30 units - Seems like in-build big/problem.
pGlyph.selectedAtShapes() is working in legacy mode so break contours is functional. Upgrade it!
I'm having difficulty with the smart corners. I click Apply Smart Corner but I get:
ERROR: Please specify a Glyph with suitable Shape Builder (Smart corner) first!
Traceback (most recent call last):
File "C:/TypeRig-master/Scripts/TypeRig GUI\Filter\Corner.py", line 106, in
self.btn_apply_smartCorner.clicked.connect(lambda: self.apply_SmartCorner(False))
File "C:/TypeRig-master/Scripts/TypeRig GUI\Filter\Corner.py", line 377, in apply_SmartCorner
active_preset = self.getPreset()
File "C:/TypeRig-master/Scripts/TypeRig GUI\Filter\Corner.py", line 210, in getPreset
active_preset_index = self.tab_presets.selectionModel().selectedIndexes[0].row()
IndexError: tuple index out of range
DONE: Update/Snapshot for glyphs: _469
I prepared a short video here: https://www.twitch.tv/videos/453177892
Find a solution for misinterpreted node selections of recurring elements in single glyph.
Now if there are multiple instances of the same element in glyph, only the first? nodes of the topmost? element are returned (and manipulated).
Now that the TR core is refactored and reorganized, it is time to revisit TR proxy code and polish it.
I'm thinking: not a GUI tool but an I/O thing with several possibilities.
https://openpyxl.readthedocs.io/en/stable/ is a library for Excel files. But in fact, this could even start with a simple CSV
I can think of various representations of conponents, but I haven't quite seen one that I'm thinking about:
A sheet should have the setup:
glyph | oldc | newc | m1.x | m2.x | m3.x |
---|---|---|---|---|---|
Aacute | A | A | 0 | 0 | 0 |
Aacute | acute | acutecomb | 250 | 282 | 321 |
m1, m2 are masters of course
On export from FL, you could decide on which properties to output and in which order. There is a situation where you'd prefer m1.x, m1.y, m2.x, m2.y but in other cases it would be better to have m1.x, m2.x, m1.y, m2.y.
Or only output/adjust the x coords as shown in the above example.
The first functionality would be to output CSV from FL and then to read it back in (and rebuild the composites)
The sorting of rows is to be figured out. Sometimes you'll want to sort by glyph, sometimes by component.
Each row is actually a transformation. Which is why there is oldc and newc
If a coordinate is empty, the coordinate of the main master (?) is used.
Once CSV I/O is done, Xslx (Excel) support could be added, and ultimately also a DeltaMachine-like big table. But I think the actual flexible CSV I/O would be paramount.
This CSV/spreadsheet format gives you "everything": adding, removing, replacing and adjusting. MM. If a column is not in the data that FL reads from csv/xlsx, that data is not changed (for new components, a default like 0 gets used)
Hey, I can make a logo design for TypeRig. If you interested we can talk about design decisions. By the way, my purpose is supporting open source project in field of graphics. I am waiting your feedback. Have a nice day! :)
Best Regards,
Baran Pirincal
Visual Communication Designer
Find a solution for grouping/ungrouping. Currently only ungroup all is implemented.
Possible implementation in Elements panel.
Collection of ideas for future improvements of Kern Class Manager
A lot of map, reduce, division and other problems....
Delete node is not working, not of the same quality as the FL6 editor or destructive!
Investigate issues and ways of new glyph creation/generation and duplicating.
Strange nested widgets/signaling functions bug that disables sdterr and stdout within a widget nested inside another, or from within connected function. Only redirecting them to file works.
Lately Smart corners part of Filter panel stopped working because of changes to the TR core, that deals with deep search. Problems:
Some functions in typerig.core.func.string
need to be fixed for Py3 unicode
This is a screencast to the issue.
http://recordit.co/Ru2NgNzrsm
A wired bug in FL, causes the deleted anchors to reappear unless they are deleted from the FL6 Anchor panel. Deleting the anchors using python works perfectly - all anchor lists (layer/glyph) report empty, but then if an anchor is using the name of one that was previously deleted, the deleted anchor (and its properties) reappears instead of the new one.
There is new math and sample code that makes a smooth Bézier node G3-continuous by adjusting the handles. This results in a smooth Curvature: not only the curvature is the same on both sides, but its change is also smooth.
The author Linus Romer explains there: "it should not be too problematic to write a Glyphs plugin with the same functionality. The math is open, the implementation under GPL. As I don't have Glyphs, someone else would have to do this."
So based on the math, it should be easy to add this to TypeRig.
Investigate a possibility to create glyph.fromJSON(), glyph.toJSON() via Adam's Automator module.
What: Place hinting links on all layers simultaneously for the selected node pair!
Depends: On links being available in the PyAPI - currently they are not!
Bring the Mixer panel back, now that DM is integrated in TR
By Eduardo's opinion it will be easier.more clear for the user to add node between two selected, not behind the one selected. Rethink ?!
I'm trying to clear anchor expressions in all masters. But pGlyph.anchors()
returns flPinPoint
s (which I have no idea how to edit) and not flAnchor
s 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'
https://recordit.co/0RBuGsmNXB
If I maximize the window, the tab ribbon on the right side becomes scrolled. But if I want to resize the window height down in non maximized mode, it's not possible.
Preferably the tab buttons could be displayed horizontally, with wrapping enabled.
A miscalculation occurs when interp. moving last node of curve that is followed by line.
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)
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.
Huerta Typografica created the HT Letterspacer, which works as a Glyphs plugin. It seems quite decent.
Unfortunately, they merged everything into one file, UI, the "engine" etc. Also, their code is GPL3.
If we were to adapt this to FontLab, this means:
TypeRigLetterspacerLib
(or so) Github repo which will hold code adapted taken from their code. Basically, it should be a Python package.Duplicate layer is not working. Current implementation only links shapes to the newly generate layer
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
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:
But when I run TypeRig panel, they change to:
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!
By default shape alignment resets transformation data, because it is more easy so... But resetting transform removes not only translation, but scaling, shearing and rotation which might be crucial in some designs. Find another way...
No undo on any of the GUI actions/functions. Either FL6 API History system is too complicated or I am missing something...
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
from typerig.proxy import pFont
font = pFont()
print font.familyName
The above actually prints full name (family + style) of the last master. (Unless it's supposed to return the Style Group Name and it's correct?)
For anyone looking here, font.fl.tfn
returns what I'm after.
Curve optimization wont work on the very last curve segment (close contour)!
Kern class manager has been neglected for quite some time. Some issues that need to be addressed:
New:
It seems that Fill bucket tool is actually a dynamic filter that messes up proper node indexing manipulation and etc. Investigate a solution!
Anchors panel is very outdated. Usage of QtTreeView could enhance visibility of all Anchors on all layers. Operations could go in contextual mode.
Collection of ideas for future improvements of Kerning Overview Manager
.. all ideas are welcome!
Newly built anchors do not show in FL Glyph window unless forced refresh. Updating the layer and glyph do not affect anchors...
Element outline hot swapping so that existing references are not broken.
Possible implementation in Elements panel.
There is a nasty bug in fgKernGroups that causes memory leak, temporary halt of application and messes up class members. Be advised not to use "Get From Font" option in Kern Class Manager
Trying to get selected nodes results an error if glyph has mixed reference (elements + components). This is mainly due to lack of clear differentiation between elements and components in the API.
Implement Pen protocol so interoperation with FontTools, RoboFab, RoboFont and etc is possible.
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.