morisawausa / _vfvisualizer

A visualizer and tool for setting up substitution rules for variable fonts
https://vfbounds.occupantfonts.com
Apache License 2.0
33 stars 0 forks source link

Fitting Test Strings #3

Open nicschumann opened 3 years ago

nicschumann commented 3 years ago

The process for fitting test strings to the appropriate width is pretty janky. It just involves calculating a constant scale factor that depends only on the number of characters in the test string. It works fine (and is performant) for short test strings, but it certainly won't work for longer words. This tool isn't really meant as a word proofing tool, so seems okay (for now). See GlyphView.vue and Visualizer.vue for instances.

Math.pow(.85, sequence.length)

Used by GlyphView.vue for the design-point preview.

Math.pow(.75, sequence.length)

Used by Visualizer.vue for the size of the glyphs in the visualizer canvas.