Skip to content

typesupply/glyph-nanny

Repository files navigation

Glyph Nanny

Screen Shot

This tool provides live feedback about the technical quality of a glyph. It's designed to help both new designers and experienced pros:

New Designers

Did you just start drawing with beziers? Yeah, I totally agree. They are frustrating. This tool is designed to help you quickly see where problems are so that you can learn how to fix them and how to avoid them in the future. Keep in mind that the displayed notes and marks are generated by math and are not a definitive list of things that must be corrected. It's always (okay, not always) acceptable to break the rules as long as you have a good reason. Think of the comments as reminders to think through why you have things where they are.

Experienced Pros

Do you get super annoyed when things are perfectly straight or you have duplicated contours or other dumb accidents like that? Me too. You can use this tool to look for whatever things you want it to in real time so that you have to stop wondering "Is that segment straight?" and "Did I hit command-V twice?" Please open an issue if there are tests that you'd like to have added to the repertoire.

Usage

If you want to turn the display on or off, or edit the list of tests performed, look under Extensions > Glyph Nanny in the application menu.

Also located under Extensions > Glyph Nanny in the application menu is an option for testing an entire font.

Scripting

Glyph Nanny's tests are available through a scripting API that is accessible through the glyphNanny module.

API

registeredTests()

Returns a dictionary of all registered tests. The keys are the test identifiers and the values are dictionaries of data about the tests.

testGlyph(glyph, tests=None)

Test glyph and return a report in the form of a dictionary. tests is a lists of the test identifiers that should be executed. If tests is None all registered tests will be executed.

testLayer(layer, tests=None, ignoreOverlap=False, progressBar=None)

Test layer and return a report in the form of a dictionary. tests is a lists of the test identifiers that should be executed. If tests is None all registered tests will be executed. If ignoreOverlap is True a non-destructive "remove overlap" operation will be performed on the data that will be tested.

testFont(font, tests=None, ignoreOverlap=False, progressBar=None)

Test font and return a report in the form of a dictionary. tests is a lists of the test identifiers that should be executed. If tests is None all registered tests will be executed. If ignoreOverlap is True a non-destructive "remove overlap" operation will be performed on the data that will be tested.

formatGlyphReport(report)

Format a dictionary report into a string.

formatLayerReport(report)

Format a dictionary report into a string.

formatFontReport(report)

Format a dictionary report into a string.

Example

import glyphNanny

glyph = CurrentGlyph()
report = glyphNanny.testGlyph(glyph)
report = glyphNanny.formatGlyphReport(report)
print(report)

Versions

2.0.5

  • Text background colors now follow the dark/light mode settings.
  • Fixed an issue with open contours in the duplicate contour test.
  • Added a test for unnecessary non-extreme curve points.
  • The font test window works again.

2.0.4

  • Made empty Merz layers invisible.
  • Fixed a situation when margin values could be undefined.

2.0.3

  • Fixed some ezui mistakes.

2.0.2

  • Fixed some embarrassing mistakes on outdated Subscriber method names. (Hey! Glyph Nanny really did make me come up with the idea for Subscriber and it really did drive the development of Subscriber!)
  • The report titles option in the preferences now works.
  • Added an option for setting if you want tests to occur during drag or after the drag is complete.
  • Changed the default behavior to process tests after a drag is complete rather than during the drag. This makes everything feel exponentially faster.
  • Fixed a bug that caused all tests to be on by default.

2.0

  • Everything has been updated for RoboFont 4.
  • Rendering is significantly faster.
  • Improved the speed of many tests.
  • It's easier to add new tests.
  • Made some improvements to make this more useful to experienced designers.
  • The font report is now text only. The image generation caused problems in very large fonts. It also required a lot of complicated code.
  • GLYPH NANNY IS NOW SCRIPTABLE.
  • Lots of bug fixes.

0.3

  • The font report is now formatted HTML, with marked up glyph images, instead of a text dump.
  • Removed the "unusually high number of contours" test. It took an unusually high number of seconds to execute.
  • Added a new test that looks for slightly asymmetric, adjacent curves.
  • Added a new test that looks for slight stem width inconsistencies. This uses the Stem Snap values defined in the PostScript hinting settings to determine the desired stem widths.
  • The vertical metrics alignment test now incorporates blue zones in the evaluation ranges.
  • Unnamed anchors are now caught by the stray point test.
  • When testing a full font, overlapping data can now be ignored.
  • The crossed handle test is now more lenient when a curve is very small.
  • The text in the displayed report can now be turned off.
  • Improved speed. (Results may vary.)
  • Improved report aesthetics. (Opinions may vary.)
  • Small bug fixes.

0.2

Minor bug fixes.

0.1

Initial version.

About

A live report about potential drawing issues in your glyph.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages