Giter Site home page Giter Site logo

trufont's Introduction

TruFont

Multi-platform UFO font editor

Build status

Maintenance status: The trufont project is currently discontinued. Although we will happily accept bug fixes, no new features are currently planned.

TruFont is a multiplatform font editor built with Python3 and PyQt5.

The wx branch contains a stub wxWidgets port of the app.

Getting started

  1. Install Python 3.6 (or later):

    • OS X: Install using Homebrew: brew install python3
    • Windows: Download installer from python.org/downloads
    • Linux: It's usually packaged with the OS.
  2. Set up a new Python virtual environment. Although this is not required, it's highly recommended, since TruFont has lots of dependencies, which may (or may not) conflict with other modules you installed globally.

    • To create a new virtual environment in ENV_DIR:

      python3 -m venv ENV_DIR

      This creates a new ENV_DIR folder (you can choose the name you want). The bin subfolder (or Scripts if you are on Windows) contains a new python executable, and the pip installer linked to that.

    • Activate the newly created environment:

      • OS X or Linux: source ENV_DIR/bin/activate
      • Windows: ENV_DIR\Scripts\activate.bat

      This temporarily adds the virtual environment's scripts folder to your console's PATH, so you can access python, pip and the trufont script from anywhere.

    • Run deactivate when you wish to exit the virtual environment. This restores the default system PATH.

  3. Install/update TruFont to the latest stable release:

    pip install --upgrade trufont

  4. Run the app as trufont.

Contributing

Here's a quick tutorial if you'd like to contribute to TruFont.

  1. Click the "Fork" button above, and clone the forked git repository to a new directory called trufont:

    git clone https://github.com/<YOUR_USERNAME>/trufont

  2. Move into the new folder and run this command to add the upstream repository url to the local list of remotes:

    git remote add upstream https://github.com/trufont/trufont

    This enables you to keep up-to-date with the upstream development.

  3. Synchronize your fork's master branch with the upstream/master, especially before creating new branches:

    git checkout master
    git fetch upstream
    git rebase upstream/master
    git push
    
  4. Install pre-commit. It will run some checks every time you are about to commit something.

    pip install pre-commit
    pre-commit install
    
  5. Now, you can create and checkout your new feature branch:

    git checkout -b my-cool-new-feature

  6. Use pip to install TruFont in "editable" mode:

    pip install --editable .

    Instead of copying trufont to your Python site-packages directory, this command only creates a link to the source directory inside the git repository. You can then modify the code in place, or synchronize the latest upstream changes (as in step 4) without having to re-install.

  7. It is also recommended to regularly update the dependencies to the curently tested versions as listed in `requirements.txt`:

    pip install --upgrade -r requirements.txt

  8. Once you have commited your patch, push the new branch to your fork:

    git push -u origin my-cool-new-feature

  9. Finally, click "New pull request" on TruFont's GitHub page to submit your patch.

trufont's People

Contributors

adrientetar avatar anthrotype avatar davelab6 avatar dependabot[bot] avatar driehuis avatar eliheuer avatar exer2k avatar felipesanches avatar graphicore avatar hartwork avatar hskim08 avatar khaledhosny avatar madig avatar moyogo avatar n7s avatar pathumego avatar pyup-bot avatar santhoshtr avatar teddywing 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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

trufont's Issues

Unable to delete offcurve points

Hello there!

I just started testing Trufont and also drew some curves with it, but now I am struggling with converting them back to straight segments by deleting the offcurve points. Delete and backspace somehow do not work to get rid of them.

Do you have a suggestion?

Best wishes
Benedikt

Provide docs

We need documentation. Also we need to make sure that defcon docs are accessible. Currently it seems the default doc in defcon only shows out-of-code descriptions and the function signatures, not the comments written inline.

QGtKstyle dependency error - blank menus

Please provide more details about the QGtKstyle dependency. Certain distros don't ship that part of QT by default and the result is blank menu entries.

It seems something with the theme engine is unhappy or simply missing. Switching the theme configuration with qt-config doesn't seem to fix it.

On Ubuntu MATE:
"QGtKstyle could not resolve GTK. Make sure you have installed the proper libraries."

It works on Debian unstable though. Thanks!

Multiple masters widgets

defconQt currently has widgets for designing individual UFOv3 fonts. I'm filing this issue to discuss and track development of widgets for designing font families, and how to structure and persist family data structures.

(I recommend creating a milestone for this, to track all issues that grow trufont from a font editor to a font family editor.)

UFOv3 Family Support

Since this is the first UFOv3 editor, how to leverage the new data structures in UFOv3 files for storing font families has not yet been fully explored anywhere (as far as I know.)

Perhaps a single UFOv3 file should be a font family, using conventions and private lib data, where each master and instance in the family is a layer.

Perhaps a UFOv3 file should not be a font family, and there should be a higher-level directory structure for "trufont projects" (or something) that contains a UFOv3 for each master and instance in the family.

Glyph Compatibility

Designing a family requires interpolation, and https://github.com/LettError/mutatorMath is ready for us to begin extending to support Python 3 and UFOv3.

However, before mutatorMath can be used, sets of .glyf files must be compatible, or "prepolated."

This requires many things to match:

  • the number of points
  • the starting point position
  • winding direction
  • order of contours and components
  • anchor points

Glyphs v2 has a productive UI for this. Here are incompatible glyphs:

compatible-10

Here are compatible glyphs:

teaser

Here is a nice dialog for reordering glyph elements:

compatible-2-1

(images from https://glyphsapp.com/tutorials/multiple-masters-part-2-keeping-your-outlines-compatible)

Space center does not auto-update when loading new font file

steps to reproduce:

  • open trufont
  • open the space center dialog
  • click file->open and load a new UFO

bad behaviour:

  • the space center dialog does not render the text
  • we have to close the dialog and reopen it in order to make it render correctly

expected result:

  • simply render the text automatically using the new loaded fontface

Why are the children of contours points not segments? Why no bPoints?

RoboFab has traditionally had contours that contain segments which contain points, and also that have bPoints. Eg in RoboFont I can run,

glyph = CurrentGlyph()
contour = glyph[0]

# access segments as children
for segment in contour:
    print(segment)
    for point in segment:
        print(point)

# access points from list of points
for point in contour.points:
    print(point)

# access bPoints
for bPoint in contour.bPoints:
    print(bPoint)

But today in Trufont, points are the direct children of contours, and bPoints don't exist:

glyph = CurrentGlyph()
contour = glyph[0]

# access contours from list of segments
for segment in contour.segments:
    print(segment)
    for point in segment:
        print(point)

# access points as children
for point in contour:
    print(point)

# access bPoints
for bPoint in contour.bPoints:
    print(bPoint)

raises AttributeError: 'TContour' object has no attribute 'bPoints'

@adrientetar why is this? :)

Button icons are not rendered

The SVG icons are not rendered at all. I tried replacing one of them with a corresponding PNG and it worked. There is some problem with SVG support in the Qt widget used for these buttons...

This was tested on GNU+Linux with code fetched from current git master (commit ec2cda3).

UI for editing anchor name

In the glyph view, double-clicking an anchor should open an "anchor properties" dialog to edit its name.

Measuring tool does not go away

I really like the triangle visual of the measuring tool, but it doesn't go away when I switch to a different tool: the triangle from the last thing I measured remains in the glyph window. In order to get it to go away, I have to switch to a different glyph, and then switch back.

[crash] glyphView keyboard input

When I run the latest git master, and press a key to jump to a encoded glyph in the glyphView, I get a crash:

Traceback (most recent call last):
  File "/usr/local/lib/python3.5/site-packages/defconQt/glyphCollectionView.py", line 274, in keyPressEvent
    unicodedata.category(event.text()) != "Cc"):
TypeError: category() argument must be a unicode character, not str
Abort trap: 6

Icon disappearing

The icon appeared when I opened Trufont for the second time, and disappeared after I closed it.

[darwin] Include NSPrincipalClass and NSHighResolutionCapable in Info.plist

Currently the mac package is not set up for retina displays:

screen shot 2015-10-23 at 14 52 48

This can be fixed simply, by including the following 2 keys in the top of TruFont.app/Contents/Info.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>NSHighResolutionCapable</key>
<true/>
...

Then a hidpi mode is used:

screen shot 2015-10-23 at 14 51 38

Idea: Python script examples

Adding pre-existing basic commented python scripts could help efforts to dive into scripting. It could be a really nice pedagogic approach as well. What do you think?

Code style and analysis

It would be good to define a coding style early and use a linter that can take a config file for the project (pylint or flake8).

Support getting/setting CurrentGlyph().contour[0].clockWise

When I run

glyph = CurrentGlyph()
contour = glyph[0] # get the first contour    
print(contour.clockWise) # get the contour direction

I get

Traceback (most recent call last):
  File "/Users/dcrossland/src2/github.com/trufont/trufont/Lib/defconQt/scriptingWindow.py", line 41, in runScript
    exec(code, global_vars)
  File "<string>", line 20, in <module>
AttributeError: 'TContour' object has no attribute 'clockWise'

I propose this should get True or False as it would in RoboFab.

Similarly I propose to be able to set the value too, eg

glyph = CurrentGlyph()
contour = glyph[0] # get the first contour    
print(contour.clockWise) # get the contour direction
contour.clockWise = not contour.clockWise # reverse the contour direction
print(contour.clockWise) # get the contour direction

and I propose the RoboFab convenience function to reverse contour direction:

contour.reverseContour()

Trufont not opening

Hello.,
I tried installing Trufont today. My comp specs are as below. When I double click nothing is happening. Please do look into it.

Thanks and Best.
screen shot 2015-10-11 at 11 58 21 pm

License

What is the license of Trufont?

Write a tracking undo manager

That makes use of defcon undoManager calls as well. Then cleanup current hackish system in glyphView.

  • should have undo/redo notifications for observers (GC)

Document how to build the app packages

@adrientetar please could you provide documentation on how to reproduce the following packages? :)

  • TruFont-X-darwin-10.9.5-x64.zip
  • TruFont-X-darwin-x64.zip
  • TruFont-X-gnu-x86.zip
  • TruFont-X-win32-x86.zip

Update:

I chatted with Adrien on 2017-03-27 and he said,

I want to make a trufont-pkg repository with a script that does everything it takes to build the packages and holds the data (e.g. manifest for Mac) but it's not done yet

Deleting points in OSx

In OSx 10.10.5, To delete points I have to hold fn+Delete Expected key is just Delete.

Crash Report: Set color to None causes a crash

I open a font, go to Edit menu, Mark Color, Red, and then again, Mark Color, None, and get a crash:

Traceback (most recent call last):
  File "/Users/dcrossland/src/github.com/trufont/trufont/Lib/defconQt/fontView.py", line 1025, in markColor
    color.getRgbF() if color is not None else None)
  File "/usr/local/lib/python3.5/site-packages/defcon/objects/color.py", line 19, in __new__
    r, g, b, a = value
TypeError: 'NoneType' object is not iterable
Abort trap: 6

jupyter qtconsole and notebook

https://jupyter.org qtconsole is a powerful REPL, that would be great to have in addition to the current scripting window.

The jupyter notebook would also be wonderful to have, especially as it could provide a 'live' introductory tutorial system.

setup.py encoding bug

$ sudo python setup.py install
  File "setup.py", line 37
SyntaxError: Non-ASCII character '\xc3' in file setup.py on line 37, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details

Define trufont's Human Interface Guidelines

Today at lunch I was chatting with @brawer about trufont, and I'd like to organize a hangout when @adrientetar is available (perhaps early evening Paris time this week?) to start figuring out what the overall Human Interface Guidelines for trufont should be.

Currently it seems to follow some of FontForge's UI, RoboFont's 'multiple window mode', FL5, Fontographer, and 'classic' MacOS:

5

RoboFont also has a 'single window mode', which is more "Cocoa like" (and similar to Glyphs and FL6)

7

(images thanks to http://cu14.blogspot.com.br/2014/06/robofont-guide-pt-1.html)

I also wrote up an introduction to the 3 'big ideas' for font editor UIs in glyphr-studio/Glyphr-Studio-1#94 which might be relevant to this.

"Smart"-sorting feature

"Smart sort" does not intuitively describe the feature.

What does it do? We should choose a more descriptive name for this feature.
Behdad suggests avoiding "super"/"Smart"-feature naming scheme in general because it is typically meaningless.

  • Specify the desired feature (for documentation purposes)
  • Choose a better name for it

[spacecenter] Show live values

In space center, when I adjust the width, the Left and Right values are not updated, even when I click them.

screen shot 2015-10-12 at 5 14 36 pm

The values should be 'live'

glyph placeholders do not scale up/down when zooming in/out

Unimplemented glyphs are replaced by placeholder. That's OK. But these placeholders do not zoom when we change the size of the glyph boxes in the main glyphs window.
This results in uglyness especially when zoom is sufficiently small in a way that the placeholders are larger than the boxes.

Desired behaviour:
Glyph place-holders should zoom proportionately to the interface boxes resizing.

Crash report

Crash from git master - I was just drawing an "A" in a new file

$ python3 -m defconQt
Traceback (most recent call last):
  File "/Users/dcrossland/src/github.com/trufont/trufont/Lib/defconQt/glyphView.py", line 1534, in mouseMoveEvent
    sel[0]._contour.addPoint((prev.x, prev.y))
  File "/usr/local/lib/python3.5/site-packages/defcon/objects/contour.py", line 594, in addPoint
    self.insertPoint(len(self._points), point)
  File "/usr/local/lib/python3.5/site-packages/defcon/objects/contour.py", line 187, in insertPoint
    self.dirty = True
  File "/usr/local/lib/python3.5/site-packages/defcon/objects/base.py", line 319, in _set_dirty
    self.postNotification(self.changeNotificationName)
  File "/usr/local/lib/python3.5/site-packages/defcon/objects/base.py", line 212, in postNotification
    dispatcher.postNotification(notification=notification, observable=self, data=data)
  File "/usr/local/lib/python3.5/site-packages/defcon/tools/notifications.py", line 195, in postNotification
    callback(notificationObj)
  File "/usr/local/lib/python3.5/site-packages/defcon/objects/glyph.py", line 1149, in _contourChanged
    self.dirty = True
  File "/Users/dcrossland/src/github.com/trufont/trufont/Lib/defconQt/objects/defcon.py", line 57, in _set_dirty
    BaseObject._set_dirty(self, value)
  File "/usr/local/lib/python3.5/site-packages/defcon/objects/base.py", line 319, in _set_dirty
    self.postNotification(self.changeNotificationName)
  File "/usr/local/lib/python3.5/site-packages/defcon/objects/base.py", line 212, in postNotification
    dispatcher.postNotification(notification=notification, observable=self, data=data)
  File "/usr/local/lib/python3.5/site-packages/defcon/tools/notifications.py", line 195, in postNotification
    callback(notificationObj)
  File "/Users/dcrossland/src/github.com/trufont/trufont/Lib/defconQt/glyphView.py", line 1928, in _glyphChanged
    self.activeGlyphChanged()
  File "/Users/dcrossland/src/github.com/trufont/trufont/Lib/defconQt/glyphView.py", line 1948, in activeGlyphChanged
    self.updateActiveLayerPath()
  File "/Users/dcrossland/src/github.com/trufont/trufont/Lib/defconQt/glyphView.py", line 2157, in updateActiveLayerPath
    self._layer, representationKey="defconQt.NoComponentsQPainterPath")
  File "/Users/dcrossland/src/github.com/trufont/trufont/Lib/defconQt/glyphView.py", line 2163, in updateLayerPath
    path = glyph.getRepresentation(representationKey)
  File "/usr/local/lib/python3.5/site-packages/defcon/objects/base.py", line 244, in getRepresentation
    representation = factory["factory"](self, **kwargs)
  File "/Users/dcrossland/src/github.com/trufont/trufont/Lib/defconQt/representationFactories/glyphViewFactory.py", line 18, in NoComponentsQPainterPathFactory
    glyph.draw(pen)
  File "/usr/local/lib/python3.5/site-packages/defcon/objects/glyph.py", line 361, in draw
    self.drawPoints(pointPen)
  File "/usr/local/lib/python3.5/site-packages/defcon/objects/glyph.py", line 371, in drawPoints
    contour.drawPoints(pointPen)
  File "/Users/dcrossland/src/github.com/trufont/trufont/Lib/defconQt/objects/defcon.py", line 96, in drawPoints
    pointPen.endPath()
  File "/usr/local/lib/python3.5/site-packages/robofab/pens/pointPen.py", line 97, in endPath
    self._flushContour(segments)
  File "/usr/local/lib/python3.5/site-packages/robofab/pens/adapterPens.py", line 47, in _flushContour
    assert len(points) == 1
AssertionError
Abort trap: 6

Development Plan or Roadmap

@adrientetar Would be awesome to have dev plan/roadmap or priorities you have in mind :) That way if there is anybody willing to contribute code can think. And would be easier to organise and manage issues according to priorities.

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.