Giter Site home page Giter Site logo

fontgoggles's Introduction

FontGoggles Icon

FontGoggles

Interactive Previewing and Comparing

For end-user documentation see fontgoggles.org.

The lastest release can be downloaded here.

FontGoggles was funded by Google Fonts.

Brief description

FontGoggles is a font viewer desktop app for macOS that supports these file formats:

  • .otf, .ttf, .otc, .ttc, .woff, .woff2
  • .ufo
  • .designspace
  • .ttx

It uses HarfBuzz for line layout, so it supports complex scripts. The source formats are partially compiled on the fly, so their line layout and variation behaviour can be realistically previewed.

When a font file changes on disk, FontGoggles will automatically reload it and show the updated version.

Build instructions

If you want to build and run the app from the source, follow these instructions.

  • Make sure you have Python 3.7 installed, preferably from python.org, but homebrew may work, too. (3.8 may work, but I didn't check whether all our dependencies are available.)

  • Clone this repository.

  • cd into the repository folder.

  • Setup a virtual environment:

    $ python3.7 -m venv venv --prompt=fontgoggles

  • Activate the environment:

    $ source venv/bin/activate

  • Update pip:

    $ pip install --upgrade pip

  • Install dependencies:

    $ pip install -r requirements.txt

  • Install dev dependencies:

    $ pip install -r requirements-dev.txt

  • Install our lib:

    $ pip install .

  • Or, if you prefer an editable install of our lib:

     $ pip install -e .
     $ ./Turbo/build_lib.sh
    

    (The latter step builds a required C library, that otherwise wouldn't get built in editable mode.)

  • Run some tests:

    $ pytest

  • Build the application:

    $ python App/setup.py py2app

You'll find the built application in App/dist/

Now you can drop some fonts onto the app, or a folder containing fonts.

fontgoggles's People

Contributors

behdad avatar chrissimpkins avatar davelab6 avatar dependabot[bot] avatar drott avatar justvanrossum avatar khaledhosny avatar kontur avatar pyup-bot avatar schriftgestalt avatar yisibl 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

fontgoggles's Issues

Feature list for Full version

  • Full support for variable fonts
  • Full support for designspace files
  • Work on optimal performance
  • External scripting
  • Final UI
  • Export as PDF/Print
  • Import a text file to be used for the proofing text, with a stepper UI and shortcuts for easy navigation

Keep filename label (and progress spinner) visible

In horizontal layout, the filename label and the progress spinner should stay where they are when scrolling horizontally. Opposite for vertical. This allows the filename to be readable even when zooming in or scrolling a long string.

Options for font sorting?

I noticed FG applies automatic sorting to fonts when files are dropped on the app icon.
The current sorting appears to look at OS/2 usWeight value first and then whether the font is roman or italic?
It does not apply any sorting when files are dropped into a window. (I assume this is intentional.)

Please consider adding an option for sorting the list of fonts at any moment.
It would be really nice if a user can define their own sorting filter so I can sort first by usWidth value, then usWeight, and then roman/italic, for example.

Feature list for Prototype

Milestones from project plan:

  • Read all non-variable font formats
  • Show properly shaped text for binary formats
  • Show only basic shaping for source formats
  • Skeleton UI

woff and woff2 currently don't work

woff2 gives a freetype error, woff outputs only .notdef while shaping (hb-shape works just fine).

It appears as if uharfbuzz doesn't support woff/woff2.

Character Overview

It would be great to be able to have a view where it shows all characters available within a font. For error checking instances and interpolation across multiple axes this can take a while when typing characters individually.

Having a grid view (similar to Glyphs/Robofont) would give a quick overview of all the characters.

Ability to copy the output glyph sequence

There is this vertical list of output glyph sequence next to the input character sequence. I was wondering it would be handy if I could copy a srting of space seperated glyph names from this glyph sequence. Maybe selecting the list and hitting CMD+C would be enough?

Document edited status

We currently don't maintain the edited status of the document, and you can close a project without getting a save prompt.

Mark features active by default as on

The way I am reading the grey/green/red status of the feature labels "grey" communicates using "whatever the renderer does by default" — however, it would be useful to actually know what features are on.

'rlig' as well as the GPOS features are on by default, but the current UI does not communicate this. I think there should be a difference between the color indicators of your choice and communicating what is active in the renderer.

TODO for Basic version

  • selection of fonts
  • [ ] feature/variations/options UI respond to font selection (see #18)
  • add bidi processing
  • make text entry, char list and glyph list reflect each others selection
  • left/right/center alignment
  • Use ufo2ft for feature building, see #5
  • Feature compilation should report errors/warnings, see #6
  • Modify font list, by drag and drop reorder, dropping fonts on it, and deleting font items, see #13 and #12

Formatting settings per font

feature/variations/options UI respond to font selection, maybe.

Perhaps the "settings are for all fonts simultaneously" is a feature.

[request] Hide font labels; column display (w/ sidebearing?)

Nice tool!

I'm interested in the possibility of using FontGoggles for visual review of glyph design and spacing consistency across a family. For that, I find it helpful to have the glyphs directly proximate to each other, so wonder if you can add a View option to hide font labels, allowing the lines of preview text to be moved closer together and without visual noise from the labels.

For the same purpose, I like to be able to look at glyphs in a grid, so they're aligned veritcally and horizontally, so wonder if a columns view could be implemented? In column view, it would also be nice to have an option to display sidebearings, to be enable visual checking of spacing consistency.

Components not updating via designspace that uses support layers

My designspace uses supports layers with components.

The components show up fine using the generated var font in FG, but if I use the designspace in FG the characters which contain nested components don't change when I move the sliders, only the non-componented glyphs change. Thanks!

Feature request: view font name table data

This is probably a bigger request than I realize, especially because so many font formats are accepted here. So, feel free to disregard/close this if you don't think it's within the intended purview of the tool. But...

Many times a day, I want to pop open a font and see its name table. Of course, I can use ttx -t name <font> and open the result in a code editor, but it would be pretty amazing to be able to just drag-and-drop a font or two onto the FontGoggles icon and see the data instantly.

There are other tools for this, but FontTableViewer refuses to open variable fonts, and OTMaster is just less nice than FontGoggles.

Still, it might be that table viewing is well outside the spec for this app, and that totally makes sense. Just wanted to suggest that someday in the future, it may be a nice layer of functionality to add.

Feature list for Basic version

  • Respond to changed data on disk
  • Show properly shaped text for source formats
  • Basic support for variable fonts
  • Basic support for designspace files
  • Fleshing out UI

Latin character should be sideways in CJK text

This is easy to review CJK Variable Fonts. However one thing I have a complaint, latin character on vertical orientation become uplight posture. It should be sideways if it uses with CJK text in default.

BiDi bug with zero width non joiner

مَتْن‌وَنِوِشْتِه

This string contains U+200C (ZERO WIDTH NON-JOINER), but the bidi algorithm strips it, causing wrong rendering:

image

Disabling the bidi algorithm fixes the rendering:
image

@typoman: is my conclusion correct in that the second screenshot is correct, and the first isn't?

one OTF doesn't refresh in FG when regenerating via fontmake

  • I generate some OTFs with fontmake
  • I load those OTFs into FG, everything shows up fine
  • I regenerate those OTFs via fontmake
  • one of the OTFs doesn't refresh in FG
  • if I close the .gggl file and open again in FG, that OTF shows up again, so it seems there's no problem with the OTF data

This is the traceback:

Traceback (most recent call last):
  File "fontgoggles/mac/mainWindow.pyc", line 488, in _loadFont
  File "fontgoggles/project.pyc", line 139, in load
  File "fontgoggles/project.pyc", line 172, in loadFont
  File "fontgoggles/font/otfFont.pyc", line 54, in load
  File "fontTools/ttLib/ttFont.pyc", line 139, in __init__
  File "fontTools/ttLib/sfnt.pyc", line 75, in __init__
fontTools.ttLib.TTLibError: Not a TrueType or OpenType font (not enough data)

Doesn't happen every single time, maybe every 3rd time or so? But when it does happen, it's always the last instance listed in the .designspace that I used in fontmake. If I change the order of instances in the designspace so that a different instance is listed last, the new last instance will be the one that has the problem in FG. Hopefully that helps to track down the issue.

Not urgent at all but thought it's worth reporting in case this affects others as well. I can email you a screen recording of this happening if it would be helpful. Thanks!

UFO feature compiler needs to catch and report errors

We also need a UI to show warnings and errors that occurred during loading/compiling.

A problem with ufo2ft is that when there's an error, it writes a temp file with the generated source, and the path of that temp file is communicated via logging warning. I will most likely post an issue or PR on the ufo2ft repo later.

User documentation / website

User documentation should be generated from markdown and should be hosted on GitHub Pages, or github.io or ReadTheDocs or something.

Consider including updated Unicode data instead of relying on built in unicodedata

Python 3.7 only has Unicode 11.0 data while 3.8 has 12.1.0 data. Unicode 13 is also around the corner right now and it would be useful to include the latest instead of relying on Python versions.

I just spent some time wondering why my Wancho (Unicode 12.0) glyphs weren't being displayed at all and it's because there is no Unicode information and bidi determination fails with

Traceback for <Task finished coro=<FGMainWindowController.textEntryChangedCallback() done, defined at fontgoggles/mac/mainWindow.pyc:593> exception=AssertionError(' not allowed here')> (most recent call last):
  File "fontgoggles/mac/mainWindow.pyc", line 599, in textEntryChangedCallback
  File "fontgoggles/misc/textInfo.pyc", line 10, in __init__
  File "fontgoggles/misc/textInfo.pyc", line 26, in text
  File "fontgoggles/misc/bidi.pyc", line 13, in applyBiDi
  File "fontgoggles/misc/bidi.pyc", line 57, in getBiDiInfo
  File "bidi/algorithm.pyc", line 466, in resolve_implicit_levels
AssertionError:  not allowed here

My quick fix is to default the type and orig to L in getBiDiInfo and then the glyphs are displayed.

    for index, (ch, chInfo) in enumerate(zip(text, storage["chars"])):
        assert ch == chInfo["ch"]
        chInfo["index"] = index
        if not chInfo["orig"] and not chInfo["type"]:
            chInfo["orig"] = 'L'
            chInfo["type"] = 'L'

[request] option to show named instances for var fonts

I love this tool so far, thank you for making this!

Currently it's handy to compare multiple styles, which I can do if I drag in generated static fonts for each style. As a user I'd like the option to see all named instances from a variable font (VF.ttf or .designspace) so I can compare characters or features across styles, particularly handy with things like feature variations.

Thanks for your consideration 🙏

Use ufo2ft FeatureWriters

For kerning and mark features.

To achieve this we need to

  • mock a subset of the defcon/ufoLib2 API for kerning, groups and anchors

Print capability

It struck me today that, since Fontgoggles provides a handy way to compare a variety of different font files, that it would also be useful to be able to print the main view screen if quickly making a proofing doc to review.

This isn’t to say that I couldn’t load up all the files in inDesign and print from there, but figure if I’ve already got what I want in fontgoggles, that’d be ideal!

TODO: implement text file reference, stepper UI

Instead of a single text entry, the user should be able to load a text file, and step through it line by line.

Each line can be edited, but I'm not sure if/how we should handle saving such edits. Perhaps edits should simply be discarded, perhaps already upon step up/down.

[ text entry ... ] [↕] [ load text file... ]

TODO UnicodePicker

  • Consider using a Popover panel that attaches to the text entry
  • implement automatic "show more": right now long result lists are truncated at 500 items

Misc Project File todo:

Save/restore:

  • typed text, text source reference
  • text handling state (bidi, etc)
  • visual alignment
  • feature state
  • VF location
  • size/margin/baseline
  • item size in font list
  • dimensions of SplitViews
  • BiDi checkbox
  • features/variation/options tab: which tab selected

TODO for Prototype

Specific things left to do:

  • Integrate main window in UI
  • add NSDocument subclass
  • integrate path c lib in setup.py, and App/setup.py
  • write and verify build instructions
  • setup CI with GitHub Actions

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.