Giter VIP home page Giter VIP logo

dotter's Introduction

Dotter

Dotter is a collection of tools for developing dotted and stroked fonts for handwriting. It consists of:

  • pendot: a Python library providing dotting and stroking of a Glyphs font instance. This is intended to be used inside Glyphs (as part of the other tools below) and as part of an automated build process when building the resulting fonts.
  • Dotter Controller: A Glyphs reporter plugin allowing you to set certain nodes of your font to have, or not have, fixed dot positions.
  • Pendot Designer: A Glyphs script allowing you to set your dotting parameters (dot size, spacing, etc.) on a font-wide, per-instance, and per-glyph basis.
  • ufostroker: A pre-compiled version of the ufostroker-py library for stroking fonts.

Installation

As this collection contains both a Glyphs plugin and a Glyphs script, the installation is slightly involved:

  1. Change to your Glyphs plugins directory:
cd ~/Library/Application Support/Glyphs 3/Plugins/
  1. Clone the Dotter repository:
git clone https://github.com/simoncozens/Dotter/
  1. Change to your Glyphs scripts directory:
cd ~/Library/Application Support/Glyphs 3/Scripts
  1. Link the Pendot Designer script into the scripts directory:
ln -s ../Plugins/Dotter/Pendot\ Designer.py .

You will also need the "fontTools" and "vanilla" libraries installed in your copy of Glyphs. These can be added from the "Modules" tab of the Glyphs plugin manager.

dotter's People

Contributors

simoncozens avatar

Stargazers

Daniel  avatar Jakob Pearson avatar Stephen Nixon avatar Seán Mongey avatar Stefan Huber avatar Masanori Ogino avatar

Watchers

 avatar Denis Moyogo Jacquerye avatar Elias Zolotas avatar  avatar

dotter's Issues

disableUndoRegistration crash has reappeared

I'm finding Pendot Designer to be suddenly unstable. It was working with no trouble for about an hour today. Then the script crashed when I was trying to switch the view in a tab to the Pendot Preview layer. I get this:

image

  • Open PendotLSource
  • Switch to tab containing full A-z and a-z
  • Run Pendot Designer and switch to Dot Regular instance
  • (the E glyph should be currently selected)
  • Choose text tool
  • Choose Pendot Preview layer
  • command-A to select all, and crash

This was the same type of bug reported on 20 May, which you then seemed to fix, as it hasn't happened since until now.

I initially suspected that some of my messing around with layers was the cause, but I get the exact same result if I roll back to the PendotL from 20 June.

Guidelines are misaligned with strokes and dots

Currently Guidelines are being defined by name, font-wide values in the master. The Thickness is then extended upwards, starting at the named value. But since strokes (and dots) are expanded in both directions, this results in guidelines and strokes that are mismatched, as in:

image

There are a few different ways this could be addressed:

  • Center Guidelines: Center them on the named height values rather than extend them vertically. This will at least center-align everything consistently. It does mean that thick strokes over thin guidelines will extend on both sides of the guideline, which is not ideal.
  • Define many more custom font-wide heights: We would add names heights like “BaselineXL”, “BaselineL”. “BaselineR”, etc. then use these. We could also center the guidelines on the height value (preferred by me), or just leave the behaviour as is and let the designer tweak it.
  • Switch to using instance-specific height values: This would allow us to tweak the guidelines to be in ideal positions, even when the thickness is different from the strokes/dots. We could also center the guidelines on the height value (preferred by me), or just leave the behaviour as is and let the designer tweak it.
  • Add an alignment adjustment option (preferred): This would involve adding a alignment preference option to each guideline in each instance. When setting a guideline you would choose the font-wide named value, the thickness, and an alignment chosen from these 7 options:
    -- Center (default)
    -- Top (top of guideline is at chosen value)
    -- Top of stroke (top of guideline is at chosen value + half of stroke width)
    -- Top of dot (top of guideline is at chosen value + half of dot width)
    -- Bottom (bottom of guideline is at chosen value, this is the current default)
    -- Bottom of stroke (bottom of guideline is at chosen value - half of stroke width)
    -- Bottom of dot (bottom of guideline is at chosen value - half of dot width)
  • Adjust the stroking/dotting algorithm to force the letters into height-limited boxes: This would be a major change in strategy, and require quite a bit of revision to the algorithms. When I looked at this long ago, our current strategy of expanding strokes in all directions won out, and I still agree, so I’d not want us to pursue this.

I’d prefer the alignment adjustment option. I’d be willing to go with switching to using instance-specific values or defining many more custom font-wide height values. In any case I’d prefer that the default be to use the value to define the center, not the bottom, of the guideline.

Use named alternate layer for the contour source if glyph exists there

Enable the designer to set (in instance custom parameters) a named layer as a source for alternate skeleton sources. If a glyph exists in that layer then the dotter would use that glyph as the source rather than the normal one.

This would allow for instance-specific alterations to the skeletal source that would change the dotted results, much like delta hints. These would then have no impact on other instances or on other operations such as stroking.

Avoid collisions of dots in adjacent glyphs

Normal dot collision avoidance does not work between two glyphs. However, connected scripts, such as Arabic, will end up with dots on top of one another by default if the skeletal strokes are designed to connect. It would be better to find a way to avoid overlapped dots. Even for scripts that do not have formal OpenType cursive connections it might be useful to somehow control this.

We could add metadata to a node (similar to forced dots) that would drop any dot at that location if a custom parameter is set. This would work for glyphs that are known to be non-final.

There may be better solutions.

Strange dotting patterns after recent changes

Recent changes are resulting in some odd dotting patterns:

image

This is using font-pendot-latin with the following settings:

userData = {
co.uk.corvelsoftware.Dotter = {
dotSize = 60;
dotSpacing = 40;
preventOverlaps = 1;
splitPaths = 1;
};

Improve dotting at tight corners

One of the most problematic situations for dotting is at sharp corners with tight angles. It's not clear how to improve these by manipulating the outline:

image

(font-pendot-latin size/spacing 60/40 with prevent overlap and split paths)

These examples are much better than some others, and have forced dots at all sharp corners of AVW. This helps with aligning dots to the baseline or cap height (but the top of A is still too low), but often there is a gap after the forced dot. It seems like the segment(s) connecting to sharp corners need some realignment to fill in the gap.

Pendot Designer traceback

In Glyphs 3.3 (3307) using Python 3.11.9 (Glyphs), and the latest Dotter (d3c2445) I get the following traceback in the Macro Panel output: (No Pendot Designer dialog box shows)

Dot Size 15
Dot Spacing 15
Prevent Overlaps True
Split Paths False
Contour Source <Default>
Stroker Width 50
Stroker Height 50
Stroker Angle 0
Start Cap round
End Cap round
Join Type round
Remove External False
Remove Internal False
Segment Wise False
Dot Size 30
Traceback (most recent call last):
  File "Pendot Designer.py", line 599
    setattr(GSApplication, "_pendotdesigner", PendotDesigner())
                                              ^^^^^^^^^^^^^^^^
  File "Pendot Designer.py", line 346, in __init__
    self.on_layer_change()
  File "Pendot Designer.py", line 516, in on_layer_change
    self.reload_values()
  File "Pendot Designer.py", line 528, in reload_values
    self.reload_guidelines()
  File "Pendot Designer.py", line 473, in reload_guidelines
    [
TypeError: 'NoneType' object is not iterable

Designer crashes on Intel

The addition of stoking to Designer causes it to crash, which looks like a problem on Intel architectures.

image

Our team is half Intel machines and half Apple Silicon so needs to run on both.

Allow dots to taper in size around named nodes

This is a possible future enhancement.

Metadata could be added to a node that says "taper near here" so that the size of dots are gradually reduced as the skeleton approaches or leaves the node. This would be very helpful for joins and other places where contours meet. Ideally the designer would be able to set the amount and 'speed' of reduction (linear, etc.).

Dot patterns are shifted down

Dot patterns are being shifted down. both in the plugin and build, in this case by 15 units, so that they no longer center on the baseline.

image

'Pendot Quick Preview' layer keeps sneaking in

The 'Pendot Quick Preview' layer is a remnant from an old version of Dotter, however editing in Glyphs with the Pendot Designer script active sometimes adds this layer back into the primary master. This occurs even after the layer has been completely removed from all glyphs with a script and the layer confirmed to be eliminated from the .glyphspackage file.

Steps to reproduce:

  • open PendotLSource, go to tab with abcdefgh... and 'e' in focus
  • run Pendot Designer
  • click on Regular in the list of Layers in the Glyphs right side panel
  • the windows changes to show the skeleton, but the Pendot Quick Preview layer suddenly appears again

Glyph parameter overrides not working

The Override mechanism seems to not be working at all for parameters. Examples:

  • open PendotL, choose tab with abcdef... and select f
  • run Pendot Designer
  • choose Dot Light instance
  • click Override glyph /f? next to Flex Percent and type 100

image

  • Create Preview Master

Nothing changes (even though changing the non-override to 100 results in a change to f - the crossbar is dotted better).

Trying to change other parameters such as Dot Size doesn't work either.

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.