Roadmap 0.9, Fixes

FX.92 CadCraft: text styles (STYLE) and a font for every text

  • Fix
  • Built · Live
  • CadCraft

STYLE (ST, TEXTSTYLE; -STYLE on the command line; Draw > Text > Text style): named styles with font, height (0 = ask each time), width factor and oblique angle, kept in the file's STYLE table (DXF/DWG already read and wrote it). New TEXT and MTEXT take the current style's font, width and slant and carry its name; changing a style changes the text that uses it in one undo step; Apply to selected text; New / Set current / Delete (a style in use and Standard are refused). Text objects now have their own font (e.font) drawn and measured in that face (canvas measurement; monospace fallback). Files: textstyles.js, textstyle-ui.js, font.js, geom.js, view.js, mtext-draw.js, plot.js, commands.js. Tests: bin/test-cadcraft.mjs section Text styles and fonts; tools/cadcraft-test/browser-textstyle.mjs. Known limit: the plotted PDF sets text in Helvetica whatever the font (the screen and the plot preview show it).

Waits on: in /lab; outcome waits on the requester's lab pass (hand check: a font that is not installed falls back; plotted PDFs still set other fonts in Helvetica)

From: Mohammad Imtaar

Add a comment

Community comments

No comments yet

Add detail as we go: how you would use it, files or steps that show the problem, what other programs do. The team reads every comment.

Sign in or create a free account to add a comment.