abey79 / vpype

The Swiss-Army-knife command-line tool for plotter vector graphics.
https://vpype.readthedocs.io/
MIT License
687 stars 61 forks source link

Cursive font glyphs are split in multiple strokes #669

Open pepijndevos opened 11 months ago

pepijndevos commented 11 months ago

I want to draw words in a single stroke with a pen plotter using mergelines and the cursive font. However, glyphs like d don't connect because the incoming stroke is not present and the downstroke is seperated.

vpype text --font cursive "bird" linemerge show

image

It's unclear to me how the pickled fonts were generated, and what the process for updating them looks like. It looks like it'd be a matter of adding a few segments that trace back on themselves, as does happen in some sans-serif fonts.

abey79 commented 11 months ago

Well, for font support I took all the available shortcuts. The fonts are basically pickled version of these: https://github.com/fogleman/axi/blob/master/axi/hershey_fonts.py

I long wanted to build proper font support, but the stroke font situation is a mess and I've never had the time to go down that rabbit hole.

tatarize commented 10 months ago

There is a plugin for TTF support. And another could be quickly written for SHX support but you'd then be left to shift through various old Adobe fonts from the 90s or whatever which was basically all the single line vector fonts that were used. Though I don't recall if they had better support for these sorts of things. It's a pretty tricky subject how to connect the letters in a font like that. But give that the D has a top and outward part it's going to need an extra pick up of the pen (unless you keep create an up and down slope for the 'd' there.