Xwt.Drawing.TextLayout.SetFontStyle C# (CSharp) Method

SetFontStyle() public method

Sets the font style of a part of text inside the T:Xwt.Drawing.TextLayout object.
public SetFontStyle ( FontStyle style, int startIndex, int count ) : void
style FontStyle The font style of the text.
startIndex int Start index of the first character to apply the font style to.
count int The number of characters to apply the font style to.
return void
		public void SetFontStyle (FontStyle style, int startIndex, int count)
		{
			AddAttribute (new FontStyleTextAttribute () { StartIndex = startIndex, Count = count, Style = style });
		}

Usage Example

Ejemplo n.º 1
0
        int DrawLinePortion(Context cr, ChunkStyle style, TextLayout layout, DocumentLine line, int visualOffset, int logicalLength)
        {
            int logicalColumn = line.GetLogicalColumn(editor, visualOffset);
            int logicalEndColumn = logicalColumn + logicalLength;
            int visualEndOffset = line.GetVisualColumn(editor, logicalEndColumn);

            int visualLength = visualEndOffset - visualOffset;

            int indexOffset = visualOffset - 1;

            layout.SetFontStyle(style.FontStyle, indexOffset, visualLength);
            layout.SetFontWeight(style.FontWeight, indexOffset, visualLength);
            if (style.Underline)
                layout.SetUnderline(indexOffset, visualLength);
            layout.SetForeground(style.Foreground, indexOffset, visualLength);

            return visualEndOffset;
        }
All Usage Examples Of Xwt.Drawing.TextLayout::SetFontStyle