VectSharp 2.6.1
A light library for C# vector graphics
Loading...
Searching...
No Matches
VectSharp.Markdown.TextFragment Class Reference

A fragment containing text. More...

Inheritance diagram for VectSharp.Markdown.TextFragment:

Public Member Functions

 TextFragment (Point position, string text, Font font, Colour colour, string tag)
 Create a new TextFragment. More...
 
override void Translate (double deltaX, double deltaY)
 Applies the specified translation to the line fragment.
Parameters
deltaXThe translation in the horizontal direction.
deltaYThe translation in the vertical direction.
More...
 
override double GetAscent (double lineAscent)
 Get the ascent of the LineFragment.
Parameters
lineAscentThe ascent of the Line on which the fragment should be drawn.
Returns
The ascent of the LineFragment.
More...
 
override double GetMaxY ()
 Get the vertical coordinate of the bottom of the LineFragment.
Returns
The vertical coordinates of the bottom of the LineFragment.
More...
 
override double GetMaxX ()
 Get the horizontal coordinate of the right side of the LineFragment.
Returns
The horizontal coordinate of the right side of the LineFragment.
More...
 
override? Point Render (Graphics graphics, double deltaY)
 Render the LineFragment on the specified graphics surface.
Parameters
graphicsThe Graphics surface on which the LineFragment will be drawn.
deltaYAdditional translation on the vertical axis.
Returns
If a text element has been drawn, this method should return the bottom-right corner of the drawn text element, otherwise null. This is used to update the MarkdownContext.BottomRight property.
More...
 
abstract void Translate (double deltaX, double deltaY)
 Applies the specified translation to the line fragment. More...
 
abstract double GetAscent (double lineAscent)
 Get the ascent of the LineFragment. More...
 
abstract double GetMaxY ()
 Get the vertical coordinate of the bottom of the LineFragment. More...
 
abstract double GetMaxX ()
 Get the horizontal coordinate of the right side of the LineFragment. More...
 
abstract ? Point Render (Graphics graphics, double deltaY)
 Render the LineFragment on the specified graphics surface. More...
 

Properties

string Text [get]
 The text contained in the fragment. More...
 
Point Position [get]
 The position of the text, relative to the cursor at the start of the line. More...
 
Font Font [get]
 The font used to draw the text. More...
 
Colour Colour [get]
 The colour used to draw the text. More...
 
- Properties inherited from VectSharp.Markdown.LineFragment
string Tag [get]
 Graphics action tag for the fragment. More...
 

Detailed Description

A fragment containing text.

Definition at line 71 of file Line.cs.

Constructor & Destructor Documentation

◆ TextFragment()

VectSharp.Markdown.TextFragment.TextFragment ( Point  position,
string  text,
Font  font,
Colour  colour,
string  tag 
)

Create a new TextFragment.

Parameters
positionThe position of the text.
textThe text contained in the fragment.
fontThe font used to draw the text.
colourThe colour used to draw the text.
tagGraphics action tag for the text.

Definition at line 101 of file Line.cs.

Member Function Documentation

◆ GetAscent()

override double VectSharp.Markdown.TextFragment.GetAscent ( double  lineAscent)
virtual

Get the ascent of the LineFragment.

Parameters
lineAscentThe ascent of the Line on which the fragment should be drawn.
Returns
The ascent of the LineFragment.

Implements VectSharp.Markdown.LineFragment.

Definition at line 117 of file Line.cs.

◆ GetMaxX()

override double VectSharp.Markdown.TextFragment.GetMaxX ( )
virtual

Get the horizontal coordinate of the right side of the LineFragment.

Returns
The horizontal coordinate of the right side of the LineFragment.

Implements VectSharp.Markdown.LineFragment.

Definition at line 129 of file Line.cs.

◆ GetMaxY()

override double VectSharp.Markdown.TextFragment.GetMaxY ( )
virtual

Get the vertical coordinate of the bottom of the LineFragment.

Returns
The vertical coordinates of the bottom of the LineFragment.

Implements VectSharp.Markdown.LineFragment.

Definition at line 123 of file Line.cs.

◆ Render()

override? Point VectSharp.Markdown.TextFragment.Render ( Graphics  graphics,
double  deltaY 
)
virtual

Render the LineFragment on the specified graphics surface.

Parameters
graphicsThe Graphics surface on which the LineFragment will be drawn.
deltaYAdditional translation on the vertical axis.
Returns
If a text element has been drawn, this method should return the bottom-right corner of the drawn text element, otherwise null. This is used to update the MarkdownContext.BottomRight property.

Implements VectSharp.Markdown.LineFragment.

Definition at line 136 of file Line.cs.

◆ Translate()

override void VectSharp.Markdown.TextFragment.Translate ( double  deltaX,
double  deltaY 
)
virtual

Applies the specified translation to the line fragment.

Parameters
deltaXThe translation in the horizontal direction.
deltaYThe translation in the vertical direction.

Implements VectSharp.Markdown.LineFragment.

Definition at line 111 of file Line.cs.

Property Documentation

◆ Colour

Colour VectSharp.Markdown.TextFragment.Colour
get

The colour used to draw the text.

Definition at line 91 of file Line.cs.

◆ Font

Font VectSharp.Markdown.TextFragment.Font
get

The font used to draw the text.

Definition at line 86 of file Line.cs.

◆ Position

Point VectSharp.Markdown.TextFragment.Position
get

The position of the text, relative to the cursor at the start of the line.

Definition at line 81 of file Line.cs.

◆ Text

string VectSharp.Markdown.TextFragment.Text
get

The text contained in the fragment.

Definition at line 76 of file Line.cs.


The documentation for this class was generated from the following file: