Skip to content

Positioning vector text characters along a curved line

Notifications You must be signed in to change notification settings

Elgot/TextOnAPathWpf

 
 

Repository files navigation

TextOnAPathWpf

Positioning vector text characters along a curved line text

VectorTextBlock NuGet

How to Install

CLI Nuget Pack command

Install-Package VextorTextBlock

https://www.nuget.org/packages/VectorTextBlock

How to Use

xmlns:vtb="clr-namespace:VectorTextBlock;assembly=VectorTextBlock"
...
<vtb:VectorTextBlock VerticalAlignment="Top" Height="185" Foreground="Blue"
    FontSize="54"
    FontWeight="Bold"
    Text="How to draw text on a path"
    ContentAlignment="Left" 
    AutoScalePath="True"  
    Stroke="Gray"
    StrokeThickness="2"
    Fill="Blue"
    ShowPath="True"
    Shift="12" 
    Padding="54">
   <vtb:VectorTextBlock.TextPath>
       <PathGeometry Figures="M 0 50 Q 25 60 50 50 Q 75 40 100 50 M 100 50 Z" />
   </vtb:VectorTextBlock.TextPath>
</vtb:VectorTextBlock>

Object

public class VectorTextBlock : Control

Properties

VektorTextBlock

Name Type Category Default Description
Text string DependencyPropertyy null Text
ContentAlignment HorizontalAlignment DependencyProperty Left Text HorizontalAlignment
Fill Brush DependencyProperty null Fill in Text Gometry object
Stroke Brush DependencyProperty null Stroke in Text Gometry object
StrokeThickness double DependencyProperty 0 Stroke Thickness
TextPath Geometry DependencyProperty null Curve path as Geomery object
PathFigure PathFigure DependencyProperty null Curve path as PathFigure object
ShowPath bool DependencyProperty false Show Curve path, stroke equals Foreground
AutoScalePath bool DependencyProperty false If true the path bounds size is maximaed
Shift double DependencyProperty 0 Horzontal shift the text to the path curve, if value is negative, the text will be under the curve
TextTrimming TextTrimming DependencyProperty 0 Text Trimming
TextDecorations TextDecorationCollection DependencyProperty 0 Text Decorations
TextWrapping TextWrapping DependencyProperty 0 Text TextWrapping

Resources

About

Positioning vector text characters along a curved line

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%