Node / Text Rendering · guide
Decorations & highlight
Current Apexify.js 6.0.0 documentation for Decorations & highlight.
Put backdrop tint under effects.highlight and typographic rules under decorations (underline, overline, strikethrough). Legacy flat highlight / underline / … still resolve via resolveTextEffects / resolveTextDecorations (nested wins).
Highlight — effects.highlight
Drawn before glow, shadow, stroke, fill, and line decorations (renderEnhancedTextLine).
| Key | Default |
|---|---|
color | #ffff00 |
gradient | Overrides color |
opacity | 0.3 |
Straight baseline: renderTextHighlight draws fillRect(x, highlightY, width, height) with highlightY = y - height * 0.8 — tuned for alphabetic baseline geometry.
Arc text: each glyph uses renderTextHighlightLocal in tangent coordinates (width = measured advance for that grapheme).
Underline / overline / strikethrough (TextLineDecoration)
Each may be true (inherits fill color + thickness ≈ fontSize * 0.05) or an object:
Same shape for overline and strikethrough.
Placement on straight lines (renderTextDecorations)
Uses ctx.measureText width from x as textAlign defines origin:
| Decoration | Y offset |
|---|---|
| Underline | y + fontSize * 0.1 |
| Overline | y - fontSize * 0.8 |
| Strikethrough | y - fontSize * 0.3 |
Gradient strokes span x → x + measuredWidth at fixed decorationY.