Skip to content

The "/" of Multilanguage, Serif and Rounded is as thick as the other strokes (Discussion #2023) - #2064

Open
mlugo-apx wants to merge 1 commit into
henmedia:mainfrom
mlugo-apx:label-slash
Open

mlugo-apx wants to merge 1 commit into
henmedia:mainfrom
mlugo-apx:label-slash

Conversation

@mlugo-apx

Copy link
Copy Markdown
Contributor

For Discussion #2023, the first of the two ways, as you chose there: the slash as thick as the other strokes in the fonts, so texts get it too, with the check on saved designs you asked for below.

Summary

  • The "/" of Multilanguage (and Stencil, drawn from the same file), Serif and Rounded is now as thick as the "l" of its typeface. It was 0.45, 0.46 and 0.37 of it: on sstuckey82's label, capitals 3.8 mm high, 0.34 mm across in Multilanguage, which a 0.4 mm nozzle leaves out. Now 0.75 mm.
  • Sans, Script and Monospace are left alone: their slash is 0.86, 0.78 and 0.90 of their "l".
  • Changelog entry and a What's new card (en, de).

How it is built

  • Three entries in GLYPH_REPAIRS (textFonts.ts), in the form of your Rounded "f" (Text with "#" (and "f" in Rounded): silhouette export fails with "Not manifold", and grouping it as a hole can lose letter counters #916): each slash keeps its outer corners, top and bottom and its advance, and its two inner corners move out until the stroke across equals the "l" at half its height. So its box does not change and the outline keeps the same commands, start corner and winding. The slash stands about 5 degrees more upright (6 in Rounded).
  • Stencil gets the same entry as Multilanguage, and loadTextFonts repairs each typeface file once, as it already fills each one once, so the two keep sharing one data object and one Font (textFonts.test.ts checks that).

Saved designs

Saved in a design on main at 247df6c, opened on this branch, each body exported as STL and compared:

In the saved design After opening on this branch
Plain text "1-1/2"" (Multilanguage) new slash; in its 60 x 15 mm box the letters keep their height and the line is 0.6% longer (46.03 to 46.30 mm)
The same text grouped with a box new slash
The same text cut by a hole old slash (identical STL); ungrouped and grouped again, it gets the new one
The same text wrapped round a cylinder old slash (identical STL)
The same text chamfered with the edge tool old slash (identical STL)
The same text hollowed (0.3 mm wall) old slash (identical STL)
The same text split, both halves; one half simplified old slash (identical STL)
The same text textured old slash (identical STL); with the texture removed it is a text again and gets the new one
Gridfinity bin with that label new slash: 600 triangles differ, all in the label
The same bin cut by a hole old slash (identical STL); ungrouped and grouped again, it gets the new one
The same bin split, both halves old slash (identical STL)
The same bin textured old slash (identical STL); with the texture removed it is a bin again and gets the new one

On main, ungrouping and grouping again gives the identical STL again, and a text or bin with its texture removed is the same STL as a new one made with the same settings, on main and on this branch alike; so the difference on the branch is the slash. Simplify and Make exact cannot be applied to a text or a bin themselves, only to bodies that already keep the old slash.

So a text or bin that has become a body of its own keeps the old slash until it is built again: for a cut one, ungrouping and grouping again does it, for a textured one removing the texture; a split, hollowed, wrapped or edge-treated one has to be made again.

One thing changes besides the slash. Kerning, on for labels and new texts, measures the room beside a slash from its outline, so a kerned line with a slash gets longer:

  • "1-1/2"": Serif +0.49%, Multilanguage +0.58%, Rounded +2.14%;
  • short lines more: "1/2" in Rounded +4.19%, "i/i" in Multilanguage +5.48%, "7/1/1" in Rounded +6.28%;
  • unkerned lines and Sans: no change.

A label or a text whose length decides its size gets letters that much smaller: if "1-1/2"" fills its shelf at 3.8 mm in Multilanguage, about 3.78 mm. A label whose capitals were just over 3 mm can fall under them and lose its text (its settings then say so): 1/2 eleven times on a 2x1 bin in Rounded, 3.057 mm, or i/i fifteen times in Multilanguage, 3.077 mm. If you would rather keep every saved text at its size, the kerning beside a slash could be measured from the old, thin outline instead: no text would move, but the slash would come that much closer to its neighbours.

Testing

On ac37f6f, on main at 247df6c.

  • npm run typecheck
  • npm test (6,871 tests in 718 files) and npm run test:e2e (1,874 in 222)
  • npm run build and npm run export
  • fontGlyphRepairs.test.ts: each repaired slash as thick as its "l" (to 5%), its box and its corners' order and winding unchanged, every other glyph as it was. Breaking it fails a test for: a slash too thin or too thick, another start corner, reversed winding, a grown box, and a dropped Multilanguage, Serif or Rounded entry; leaving out the per-file repair fails the Stencil check in textFonts.test.ts. Dropping only Stencil's entry passes: the file is repaired under Multilanguage's name, which comes first.
  • In the editor (dev build, Chrome, on ac37f6f): the saved-design table above, each design made with the bridge on main, saved, opened through the start page's Open on this branch, every body exported as STL from both and compared byte for byte.

Notes

  • Changes in your code: only the slash of those typefaces, and the kerning beside it as above. Storage, import, export, grouping and undo: not touched. Fonts of your own are not touched: the repairs are keyed by the built-in typefaces' names (textFonts.ts).
  • Rounded's thicker slash now touches /T, /X, Z/, t/ and x/, which cleared it by under 0.06 mm at capitals 3.8 mm; Rounded already overlapped in /Y, K/ and others. Serif comes closer but keeps a gap (0.04 mm at the closest, /Y, /V and /W, from 0.06); in Multilanguage no pair touches (0.35 mm at the closest).
  • Left as they are, for you to decide: the Japanese face's slash is 47 units against an "l" of 61 (about 0.26 mm at 3.8 mm capitals; its whole face is thin, and it is built by scripts/build-japanese-typeface.mjs), Monospace's slash is 0.42 mm, and the backslash is as thin as the old slash in Multilanguage, Serif and Rounded.

🤖 Generated with Claude Code

…strokes (Discussion henmedia#2023)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant