feat(): Using text - #219
Open
asturur wants to merge 4 commits into
Open
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.