Giter Club home page Giter Club logo

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

tfont's People

Contributors

adrientetar avatar anthrotype avatar madig avatar

Stargazers

 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

tfont's Issues

Kerning is unstructured as Dict[rapidjson.RawJSON, int], making JSON dumping fail

Try e.g. with the Ubuntu font

tf = tfont.converters.UFOConverter().open("Ubuntu-B.ufo")
tfont.converters.TFontConverter().save(tf, "/tmp/test.tfont")
In [7]: TFontConverter().save(t, "/tmp/test.tfont")                             
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-7-c90fe6857802> in <module>
----> 1 TFontConverter().save(t, "/tmp/test.tfont")

~/Entwicklung/tfont/src/tfont/converters/tfontConverter.py in save(self, font, path)
    141         d = self.unstructure(font)
    142         with open(path, 'w') as file:
--> 143             json.dump(d, file, indent=self._indent)
    144 
    145     def structure_attrs_fromdict(self, obj, cl):

TypeError: keys must be strings

Kerning in d["masters"]["Bold"]["hKerning"] looks like this:

[...,
<rapidjson.RawJSON object at 0x7f238b90a540>: 29
...]

Deleting kerning makes dumping work.

Support for sparse masters

Analogous to googlefonts/glyphsLib#468.

How to best support sparse masters/brace layers? What convention to use? Specifically named layers in glyphs? Masters at a specific location that contain just the glyphs in question? I'd suppose Using layers instead of masters is probably easier as otherwise you'd need to add a new master every time.

Implement qcurve handling

Continuation of the work in trufont/trufont#599.

One test case: open a font with qcurves (e.g. Ubuntu-B.ufo) and try to write text in the font view.

Note to self: look at fontTools' decomposeQuadraticSegment function to generate implied on-curves, compute bounds for one sub-segemnt and unionize all bounds.

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.