GithubHelp home page GithubHelp logo

kateliev / typerig Goto Github PK

View Code? Open in Web Editor NEW
45.0 13.0 2.0 5.37 MB

Proxy API and Font Development Toolkit for FontLab

Home Page: https://kateliev.github.io/TypeRig/

License: BSD 3-Clause "New" or "Revised" License

Python 100.00%
python27 python font fontlab typedesign fontlab-7 fontlab-vi delta-machine kateliev typerig

typerig's People

Contributors

kateliev avatar twardoch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

twardoch hwk1984

typerig's Issues

[Enchance] Layers Panel

Most of the stuff in layers panel could go into Contextual menus, so that it clears space for more advanced stuff.

[Add] Element/Shape related operations

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.

Break contour

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!

Smart Corners

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

[Fix] Node selection in elements

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).

[EPIC] Refactor .proxy

Now that the TR core is refactored and reorganized, it is time to revisit TR proxy code and polish it.

Components to Excel I/O

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 newc is present and oldc is empty, newc is added to the glyph
  • if newc is empty, oldc gets deleted
  • if newc = oldc or there is only one column (newc), the data is only for adjustment
  • if newc != oldc, oldc is replaced with 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)

[loose] Some links to other PythonQt, Pyside2, PyQt5 projects

Logo Design Work: TypeRig

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

[Py3] Math fix

A lot of map, reduce, division and other problems....

Delete node

Delete node is not working, not of the same quality as the FL6 editor or destructive!

No output - FL6 Build 6578

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.

[Py3] Unicode fix

Some functions in typerig.core.func.string need to be fixed for Py3 unicode

Anchor panel - Undead anchors

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.

[Add] G3-Smooth Curvature

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.

[Try] fromJSON, toJSON

Investigate a possibility to create glyph.fromJSON(), glyph.toJSON() via Adam's Automator module.

[Add] Hinting links

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!

`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'

Cannot size window down

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.

Interpolated move

A miscalculation occurs when interp. moving last node of curve that is followed by line.

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

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.

[wish] TR Letterspacer

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:

  1. Create a separate TypeRigLetterspacerLib (or so) Github repo which will hold code adapted taken from their code. Basically, it should be a Python package.
  2. In the TypeRig repo, only add FL/TR-unique code, recreated conceptually from the HT Letterspacer GUI.

Duplicate Layer

Duplicate layer is not working. Current implementation only links shapes to the newly generate layer

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

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!

[Fix] Shape alignment resets transform

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...

TypeRig GUI - No Undo!

No undo on any of the GUI actions/functions. Either FL6 API History system is too complicated or I am missing something...

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

pFont.familyName incorrect

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

Curve optimization wont work on the very last curve segment (close contour)!

[FIX] Manager: Kern Class Manager

Kern class manager has been neglected for quite some time. Some issues that need to be addressed:

  • loading font class data directly from currently active font was not working long ago - BUT now it seems that that API is fixed and one could import properly the class position (left, right, both). Now that FL works correctly it is time to fix the manager;
  • auto building classes from shape references was not working for quite some time.

New:

  • auto building classes from components, as we have these for quite some time now :) (but not in the past)

Fill bucket problems

It seems that Fill bucket tool is actually a dynamic filter that messes up proper node indexing manipulation and etc. Investigate a solution!

[Enchance] Anchors Panel

Anchors panel is very outdated. Usage of QtTreeView could enhance visibility of all Anchors on all layers. Operations could go in contextual mode.

[Collect] Manager: Kerning Overview

Collection of ideas for future improvements of Kerning Overview Manager

  • Add Extend kerning from FL App Automator
  • Add Match kerning from FL App Automator
  • Duplicate kerning cleanup algorithms that are now from Kerning panel
  • Add rounding algorithms from IMPEX importer
  • Add cutout filter for cutting values above and below certain limit
  • Add Find and replace of numerical values
  • Add Auto replace for NOVAL with 0 or any other value
  • Add Punchboard for copying values from similar masters for Kern Matching (NOVAL fix)

.. all ideas are welcome!

Anchor panel - FL GW refresh

Newly built anchors do not show in FL Glyph window unless forced refresh. Updating the layer and glyph do not affect anchors...

[Add] Element hot swap

Element outline hot swapping so that existing references are not broken.
Possible implementation in Elements panel.

Fontlab Kern Classes Memory leak

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

[Fix] Node selection in mixed reference glyph

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.