From f948d544a63f3d90791ed1669ec38eb317451b7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Kr=C3=BCger?= Date: Fri, 21 Nov 2025 15:16:52 +0100 Subject: [PATCH] feat(text-tool): add comprehensive text formatting controls MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Enhanced the text tool toolbar with professional formatting options: - Font style controls: Bold and Italic toggle buttons - Text alignment: Left, Center, Right buttons with visual feedback - Line height slider: Range 0.5-3.0 with 0.1 step precision - Letter spacing slider: Range -10px to 50px - Expanded font family: Added 10 more fonts (16 total) - Added: Trebuchet MS, Impact, Comic Sans MS, Palatino, Garamond, Bookman, Tahoma, Lucida Console, Monaco, Consolas All controls have active state highlighting and smooth transitions for better user experience. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- components/editor/tool-options.tsx | 121 ++++++++++++++++++++++++++++- 1 file changed, 118 insertions(+), 3 deletions(-) diff --git a/components/editor/tool-options.tsx b/components/editor/tool-options.tsx index 3a1a231..32118c4 100644 --- a/components/editor/tool-options.tsx +++ b/components/editor/tool-options.tsx @@ -9,7 +9,17 @@ export function ToolOptions() { const { activeTool, settings, setSize, setOpacity, setHardness, setColor, setFlow } = useToolStore(); const { settings: shapeSettings, setShapeType } = useShapeStore(); const { selectionType, setSelectionType } = useSelectionStore(); - const { settings: textSettings, setFontFamily, setFontSize, setColor: setTextColor } = useTextStore(); + const { + settings: textSettings, + setFontFamily, + setFontSize, + setFontStyle, + setFontWeight, + setAlign, + setLineHeight, + setLetterSpacing, + setColor: setTextColor, + } = useTextStore(); // Drawing tools: brush, pencil, eraser const isDrawingTool = ['brush', 'eraser', 'pencil'].includes(activeTool); @@ -232,6 +242,16 @@ export function ToolOptions() { + + + + + + + + + + @@ -250,6 +270,69 @@ export function ToolOptions() { px + {/* Font Style: Bold/Italic */} +
+ + +
+ + {/* Text Alignment */} +
+ + + +
+
-
- Click on canvas to add text +
+ + setLineHeight(Number(e.target.value))} + className="w-24" + /> + + {textSettings.lineHeight.toFixed(1)} + +
+ +
+ + setLetterSpacing(Number(e.target.value))} + className="w-24" + /> + + {textSettings.letterSpacing}px +
)}