What problem does it solve? TextKit 2's viewport-driven layout, fragment geometry, and rendering-attribute system are easy to misuse, producing clipped diacritics, jiggling scroll bars, missing trailing cursors, and glyphs rendered as .notdef boxes. This Skill explains how the viewport layout pass, layout fragments, line fragments, and rendering attributes actually work so you can implement and debug custom text rendering correctly. ## Core Features & Use Cases - Viewport Layout Model: Explains NSTextViewportLayoutController callbacks, estimated vs visible regions, and why usageBoundsForTextContainer.height causes scroll-bar jiggle. - Fragment Geometry: Covers layoutFragmentFrame vs renderingSurfaceBounds, line-fragment local coordinates, the extra trailing line fragment, exclusion-path line splitting, and lineFragmentPadding vs textContainerInset. - Rendering Attributes & Font Substitution: Distinguishes rendering attributes from storage attributes and explains why fonts must be set in willProcessEditing so fixAttributes can perform fallback substitution. - Use Case: You are building a custom editor and the cursor disappears after a trailing newline, or a custom fragment's drawing is clipped at its frame edge. This Skill identifies the missing .ensuresExtraLineFragment option or the missing renderingSurfaceBounds override. ## Quick Start Ask the AI to explain why your custom NSTextLayoutFragment drawing is clipped at the layout frame and how to fix it with renderingSurfaceBounds.