11use core_types:: { Ctx , table:: Table } ;
22use graph_craft:: wasm_application_io:: WasmEditorApi ;
33use graphic_types:: Vector ;
4- pub use text_nodes:: text_on_path:: { TextAnchor , TextPathSide } ;
4+ pub use text_nodes:: text_on_path:: { LengthAdjust , TextAnchor , TextPathMethod , TextPathSide , TextPathSpacing } ;
55pub use text_nodes:: * ;
66
77/// Draws a text string as vector geometry with a choice of font and styling.
@@ -106,6 +106,28 @@ fn text_on_path<'i: 'n>(
106106 side : text_nodes:: text_on_path:: TextPathSide ,
107107 /// Text anchor point — affects where along the path the text is anchored.
108108 text_anchor : text_nodes:: text_on_path:: TextAnchor ,
109+ /// Glyph rendering method. 'Align' uses rigid transforms; 'Stretch' warps glyphs along the path curvature.
110+ method : text_nodes:: text_on_path:: TextPathMethod ,
111+ /// Spacing mode. 'Exact' uses computed positions; 'Auto' adjusts for path curvature.
112+ spacing : text_nodes:: text_on_path:: TextPathSpacing ,
113+ /// Whether a forced text length is enabled.
114+ #[ widget( ParsedWidgetOverride :: Hidden ) ]
115+ has_text_length : bool ,
116+ /// If set, forces the total text advance to this length along the path.
117+ #[ unit( " px" ) ]
118+ #[ hard_min( 0. ) ]
119+ text_length : f64 ,
120+ /// How to fit text to the forced text length: adjust spacing only, or spacing and glyph widths.
121+ length_adjust : text_nodes:: text_on_path:: LengthAdjust ,
122+ /// Whether a custom path authoring length is enabled.
123+ #[ widget( ParsedWidgetOverride :: Hidden ) ]
124+ has_path_length : bool ,
125+ /// Authoring path length for scaling startOffset. Maps the offset to the actual path length.
126+ #[ unit( " px" ) ]
127+ #[ hard_min( 0. ) ]
128+ path_length : f64 ,
129+ /// Right-to-left text direction.
130+ rtl : bool ,
109131) -> Table < Vector > {
110132 text_nodes:: text_on_path:: place_text_on_path (
111133 & text,
@@ -117,6 +139,13 @@ fn text_on_path<'i: 'n>(
117139 start_offset_percent,
118140 side,
119141 text_anchor,
142+ method,
143+ spacing,
144+ has_text_length. then_some ( text_length) ,
145+ length_adjust,
146+ has_path_length. then_some ( path_length) ,
147+ rtl,
120148 & editor_resources. font_cache ,
121149 )
122150}
151+
0 commit comments