Skip to content

feat(): Using text - #219

Open
asturur wants to merge 4 commits into
mainfrom
using-text
Open

feat(): Using text#219
asturur wants to merge 4 commits into
mainfrom
using-text

Conversation

@asturur

@asturur asturur commented Jul 30, 2026

Copy link
Copy Markdown
Member

An ai AIDED doc page for text.
I wouldn't have time to dedicate a full text write up, this will serve as a base to refine with human quality.

asturur and others added 4 commits July 30, 2026 03:21
Nine pages under a collapsible `Text` group, ordered 310-390 so it sits
between core concepts and configuring defaults. Text was the largest gap in
the modern docs — the only coverage was a v2-era Old docs page and a
properties section in a 2012 intro.

- choosing-a-class: FabricText/IText/Textbox as a chain rather than a menu,
  that Textbox extends IText, that only set() re-lays-out, and the three
  index spaces (string, grapheme, logical vs visual line).
- layout-and-appearance: font, spacing, alignment, decorations,
  backgrounds. charSpacing is thousandths of an em; height excludes the
  last line's gap; an invalid ctx.font is silently ignored.
- fonts: how measurement works, why a late webfont permanently poisons a
  global cache keyed without fontSize, and the clearFontCache ->
  initDimensions -> dirty -> setCoords recovery. There is no font loader in
  fabric, and config.addFonts is SVG-export only.
- character-styles: the styles shape, the 14 styleable properties, the
  endIndex trap, deferred re-measure, and custom style properties.
- editing: lifecycle, the full event table with firing order, selection and
  caret, the four keymaps, IME, clipboard, drag and drop.
- textbox-wrapping: greedy first-fit, width vs scaleX, dynamicMinWidth as a
  floor, splitByGrapheme for CJK, logical vs visual lines.
- editing-ui: the integration cookbook — toolbar focus, reading and
  applying formatting, programmatic edits while editing, undo/redo, mobile,
  accessibility.
- text-on-a-path: beta limits, single line only, the direct-assignment trap.
- serializing-text: style range compression and its lossiness, SVG export
  and the much weaker import.

Four pages carry a barebone interactive canvas. Claims were checked against
a running build rather than only read from source, which corrected three:
an assigned Textbox height survives until the next layout pass rather than
being rejected; passing `undefined` to setSelectionStyles removes the
override and reverts to the object value rather than doing nothing; and a
style declaration holding only unknown properties makes toObject() throw
rather than silently dropping them.

Also link the three classes from core-concepts.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Branch state, setup gotchas (westures, submodule at v740), the layout of the
Text guide group, the library findings turned up while verifying the docs,
and the open follow-ups. Scratch file — delete before merging.

Co-Authored-By: Claude Opus 4.8 <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