[]
        
(Showing Draft Content)

GrapeCity.Documents.DX.DirectWrite.TextLayout

Class TextLayout

Namespace
GrapeCity.Documents.DX.DirectWrite
Assembly
GcDocs.DX.Windows.dll

IDWriteTextLayout

[Guid("53737037-6d14-410b-9bfe-0b182bb70961")]
public class TextLayout : TextFormat, IDisposable, IUnknown
Inheritance
object
TextLayout
Implements
System.IDisposable
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()

Constructors

TextLayout(IntPtr)

Initializes a new instance of the TextLayout class.

public TextLayout(IntPtr nativePtr)

Parameters

nativePtr System.IntPtr

The native pointer.

Properties

Metrics

GetMetrics

public TextMetrics Metrics { get; }

Property Value

TextMetrics

OverhangMetrics

GetOverhangMetrics

public OverhangMetrics OverhangMetrics { get; }

Property Value

OverhangMetrics

Methods

Create(Factory, string, TextFormat, float, float, float, bool)

Create a Gdi Compatible TextLayout. Takes a string, format, and associated constraints, and produces an object representing the result, formatted for a particular display resolution and measuring mode.

public static TextLayout Create(Factory factory, string text, TextFormat textFormat, float layoutWidth, float layoutHeight, float pixelsPerDip, bool useGdiNatural)

Parameters

factory Factory

an instance of Factory

text string

An array of characters that contains the string to create a new C1.Win.DX.DirectWrite.TextLayout object from. This array must be of length stringLength and can contain embedded NULL characters.

textFormat TextFormat

The text formatting object to apply to the string.

layoutWidth float

The width of the layout box.

layoutHeight float

The height of the layout box.

pixelsPerDip float

The number of physical pixels per DIP (device independent pixel). For example, if rendering onto a 96 DPI device pixelsPerDip is 1. If rendering onto a 120 DPI device pixelsPerDip is 1.25 (120/96).

useGdiNatural bool

Instructs the text layout to use the same metrics as GDI bi-level text when set to FALSE. When set to TRUE, instructs the text layout to use the same metrics as text measured by GDI using a font created with CLEARTYPE_NATURAL_QUALITY.

Returns

TextLayout

Remarks

The resulting text layout should only be used for the intended resolution, and for cases where text scalability is desired {{CreateTextLayout}} should be used instead.

Create(Factory, string, TextFormat, float, float, float, Matrix3x2?, bool)

Create a Gdi Compatible TextLayout. Takes a string, format, and associated constraints, and produces an object representing the result, formatted for a particular display resolution and measuring mode.

public static TextLayout Create(Factory factory, string text, TextFormat textFormat, float layoutWidth, float layoutHeight, float pixelsPerDip, Matrix3x2? transform, bool useGdiNatural)

Parameters

factory Factory

an instance of Factory

text string

An array of characters that contains the string to create a new C1.Win.DX.DirectWrite.TextLayout object from. This array must be of length stringLength and can contain embedded NULL characters.

textFormat TextFormat

The text formatting object to apply to the string.

layoutWidth float

The width of the layout box.

layoutHeight float

The height of the layout box.

pixelsPerDip float

The number of physical pixels per DIP (device independent pixel). For example, if rendering onto a 96 DPI device pixelsPerDip is 1. If rendering onto a 120 DPI device pixelsPerDip is 1.25 (120/96).

transform Matrix3x2?

An optional transform applied to the glyphs and their positions. This transform is applied after the scaling specifies the font size and pixels per DIP.

useGdiNatural bool

Instructs the text layout to use the same metrics as GDI bi-level text when set to FALSE. When set to TRUE, instructs the text layout to use the same metrics as text measured by GDI using a font created with CLEARTYPE_NATURAL_QUALITY.

Returns

TextLayout

Remarks

The resulting text layout should only be used for the intended resolution, and for cases where text scalability is desired {{CreateTextLayout}} should be used instead.

Create(Factory, string, TextFormat, float, float)

Takes a string, text format, and associated constraints, and produces an object that represents the fully analyzed and formatted result.

public static TextLayout Create(Factory factory, string text, TextFormat textFormat, float maxWidth, float maxHeight)

Parameters

factory Factory

an instance of Factory

text string

An array of characters that contains the string to create a new TextLayout object from. This array must be of length stringLength and can contain embedded NULL characters.

textFormat TextFormat

A pointer to an object that indicates the format to apply to the string.

maxWidth float

The width of the layout box.

maxHeight float

The height of the layout box.

Returns

TextLayout

DetermineMinWidth()

HRESULT IDWriteTextLayout::DetermineMinWidth([Out] float* minWidth)

public float DetermineMinWidth()

Returns

float

Draw(ITextRenderer, float, float)

Draws text using the specified client drawing context.

public void Draw(ITextRenderer renderer, float originX, float originY)

Parameters

renderer ITextRenderer

Pointer to the set of callback functions used to draw parts of a text string.

originX float

The x-coordinate of the layout's left side.

originY float

The y-coordinate of the layout's top side.

Remarks

To draw text with this method, a textLayout object needs to be created by the application using CreateTextLayout(string, int, TextFormat, float, float). After the textLayout object is obtained, the application calls the IDWriteTextLayout::Draw method to draw the text, decorations, and inline objects. The actual drawing is done through the callback interface passed in as the textRenderer argument; there, the corresponding DrawGlyphRun API is called.

Draw(object, ITextRenderer, float, float)

Draws text using the specified client drawing context.

public void Draw(object clientDrawingContext, ITextRenderer renderer, float originX, float originY)

Parameters

clientDrawingContext object

An application-defined drawing context.

renderer ITextRenderer

Pointer to the set of callback functions used to draw parts of a text string.

originX float

The x-coordinate of the layout's left side.

originY float

The y-coordinate of the layout's top side.

Remarks

To draw text with this method, a textLayout object needs to be created by the application using CreateTextLayout(string, int, TextFormat, float, float). After the textLayout object is obtained, the application calls the IDWriteTextLayout::Draw method to draw the text, decorations, and inline objects. The actual drawing is done through the callback interface passed in as the textRenderer argument; there, the corresponding DrawGlyphRun API is called.

GetClusterMetrics()

Retrieves logical properties and measurements of each glyph cluster.

public ClusterMetrics[] GetClusterMetrics()

Returns

ClusterMetrics[]

Returns metrics, such as line-break or total advance width, for a glyph cluster.

Remarks

If maxClusterCount is not large enough, then E_NOT_SUFFICIENT_BUFFER, which is equivalent to HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER), is returned and actualClusterCount is set to the number of clusters needed.

GetClusterMetrics(ClusterMetrics[], int, out int)

HRESULT IDWriteTextLayout::GetClusterMetrics([Out, Buffer, Optional] DWRITE_CLUSTER_METRICS* clusterMetrics,[In] unsigned int maxClusterCount,[Out] unsigned int* actualClusterCount)

public HResult GetClusterMetrics(ClusterMetrics[] clusterMetrics, int maxClusterCount, out int actualClusterCount)

Parameters

clusterMetrics ClusterMetrics[]
maxClusterCount int
actualClusterCount int

Returns

HResult

GetDrawingEffect(int, out TextRange)

HRESULT IDWriteTextLayout::GetDrawingEffect([In] unsigned int currentPosition,[Out] void** drawingEffect,[Out, Optional] DWRITE_TEXT_RANGE* textRange)

public IntPtr GetDrawingEffect(int currentPosition, out TextRange textRange)

Parameters

currentPosition int
textRange TextRange

Returns

System.IntPtr

GetDrawingEffect(int)

Gets the application-defined drawing effect at the specified text position.

public IntPtr GetDrawingEffect(int currentPosition)

Parameters

currentPosition int

The position of the text whose drawing effect is to be retrieved.

Returns

System.IntPtr

a reference to the current application-defined drawing effect. Usually this effect is a foreground brush that is used in glyph drawing.

GetFontCollection(int, out TextRange)

HRESULT IDWriteTextLayout::GetFontCollection([In] unsigned int currentPosition,[Out] IDWriteFontCollection** fontCollection,[Out, Optional] DWRITE_TEXT_RANGE* textRange)

public FontCollection GetFontCollection(int currentPosition, out TextRange textRange)

Parameters

currentPosition int
textRange TextRange

Returns

FontCollection

GetFontCollection(int)

Gets the font collection associated with the text at the specified position.

public FontCollection GetFontCollection(int currentPosition)

Parameters

currentPosition int

The position of the text to inspect.

Returns

FontCollection

a reference to the current font collection.

GetFontFamilyName(int, out TextRange)

Gets the font family name of the text at the specified position.

public string GetFontFamilyName(int currentPosition, out TextRange textRange)

Parameters

currentPosition int

The position of the text to examine.

textRange TextRange

The range of text that has the same formatting as the text at the position specified by currentPosition. This means the run has the exact formatting as the position specified, including but not limited to the font family name.

Returns

string

the font family name

GetFontFamilyName(int, IntPtr, int, out TextRange)

HRESULT IDWriteTextLayout::GetFontFamilyName([In] unsigned int currentPosition,[Out, Buffer] wchar_t* fontFamilyName,[In] unsigned int nameSize,[Out, Optional] DWRITE_TEXT_RANGE* textRange)

public void GetFontFamilyName(int currentPosition, IntPtr fontFamilyName, int nameSize, out TextRange textRange)

Parameters

currentPosition int
fontFamilyName System.IntPtr
nameSize int
textRange TextRange

GetFontFamilyName(int)

Gets the font family name of the text at the specified position.

public string GetFontFamilyName(int currentPosition)

Parameters

currentPosition int

The position of the text to examine.

Returns

string

the font family name

GetFontFamilyNameLength(int, out int, out TextRange)

HRESULT IDWriteTextLayout::GetFontFamilyNameLength([In] unsigned int currentPosition,[Out] unsigned int* nameLength,[Out, Optional] DWRITE_TEXT_RANGE* textRange)

public void GetFontFamilyNameLength(int currentPosition, out int nameLength, out TextRange textRange)

Parameters

currentPosition int
nameLength int
textRange TextRange

GetFontSize(int, out TextRange)

HRESULT IDWriteTextLayout::GetFontSize([In] unsigned int currentPosition,[Out] float* fontSize,[Out, Optional] DWRITE_TEXT_RANGE* textRange)

public float GetFontSize(int currentPosition, out TextRange textRange)

Parameters

currentPosition int
textRange TextRange

Returns

float

GetFontSize(int)

Gets the font em height of the text at the specified position.

public float GetFontSize(int currentPosition)

Parameters

currentPosition int

The position of the text to inspect.

Returns

float

the size of the font in ems of the text at the specified position.

GetFontStretch(int, out TextRange)

HRESULT IDWriteTextLayout::GetFontStretch([In] unsigned int currentPosition,[Out] DWRITE_FONT_STRETCH* fontStretch,[Out, Optional] DWRITE_TEXT_RANGE* textRange)

public FontStretch GetFontStretch(int currentPosition, out TextRange textRange)

Parameters

currentPosition int
textRange TextRange

Returns

FontStretch

GetFontStretch(int)

Gets the font stretch of the text at the specified position.

public FontStretch GetFontStretch(int currentPosition)

Parameters

currentPosition int

The position of the text to inspect.

Returns

FontStretch

a value which indicates the type of font stretch (also known as width) being applied at the specified position.

GetFontStyle(int, out TextRange)

HRESULT IDWriteTextLayout::GetFontStyle([In] unsigned int currentPosition,[Out] DWRITE_FONT_STYLE* fontStyle,[Out, Optional] DWRITE_TEXT_RANGE* textRange)

public FontStyle GetFontStyle(int currentPosition, out TextRange textRange)

Parameters

currentPosition int
textRange TextRange

Returns

FontStyle

GetFontStyle(int)

Gets the font style (also known as slope) of the text at the specified position.

public FontStyle GetFontStyle(int currentPosition)

Parameters

currentPosition int

The position of the text to inspect.

Returns

FontStyle

a value which indicates the type of font style (also known as slope or incline) being applied at the specified position.

GetFontWeight(int, out TextRange)

HRESULT IDWriteTextLayout::GetFontWeight([In] unsigned int currentPosition,[Out] DWRITE_FONT_WEIGHT* fontWeight,[Out, Optional] DWRITE_TEXT_RANGE* textRange)

public FontWeight GetFontWeight(int currentPosition, out TextRange textRange)

Parameters

currentPosition int
textRange TextRange

Returns

FontWeight

GetFontWeight(int)

Gets the font weight of the text at the specified position.

public FontWeight GetFontWeight(int currentPosition)

Parameters

currentPosition int

The position of the text to inspect.

Returns

FontWeight

a value which indicates the type of font weight being applied at the specified position.

GetInlineObject(int, out TextRange)

HRESULT IDWriteTextLayout::GetInlineObject([In] unsigned int currentPosition,[Out] IDWriteInlineObject** inlineObject,[Out, Optional] DWRITE_TEXT_RANGE* textRange)

public IInlineObject GetInlineObject(int currentPosition, out TextRange textRange)

Parameters

currentPosition int
textRange TextRange

Returns

IInlineObject

GetInlineObject(int)

Gets the inline object at the specified position.

public IInlineObject GetInlineObject(int currentPosition)

Parameters

currentPosition int

The specified text position.

Returns

IInlineObject

an application-defined inline object.

GetLineMetrics()

Retrieves the information about each individual text line of the text string.

public LineMetrics[] GetLineMetrics()

Returns

LineMetrics[]

If the method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

If maxLineCount is not large enough E_NOT_SUFFICIENT_BUFFER, which is equivalent to HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER), is returned and *actualLineCount is set to the number of lines needed.

GetLineMetrics(LineMetrics[], int, out int)

HRESULT IDWriteTextLayout::GetLineMetrics([Out, Buffer, Optional] DWRITE_LINE_METRICS* lineMetrics,[In] unsigned int maxLineCount,[Out] unsigned int* actualLineCount)

public HResult GetLineMetrics(LineMetrics[] lineMetrics, int maxLineCount, out int actualLineCount)

Parameters

lineMetrics LineMetrics[]
maxLineCount int
actualLineCount int

Returns

HResult

GetLocaleName(int, out TextRange)

Gets the locale name of the text at the specified position.

public string GetLocaleName(int currentPosition, out TextRange textRange)

Parameters

currentPosition int

The position of the text to inspect.

textRange TextRange

The range of text that has the same formatting as the text at the position specified by currentPosition. This means the run has the exact formatting as the position specified, including but not limited to the locale name.

Returns

string

the locale name of the text at the specified position.

GetLocaleName(int, IntPtr, int, out TextRange)

HRESULT IDWriteTextLayout::GetLocaleName([In] unsigned int currentPosition,[Out, Buffer] wchar_t* localeName,[In] unsigned int nameSize,[Out, Optional] DWRITE_TEXT_RANGE* textRange)

public void GetLocaleName(int currentPosition, IntPtr localeName, int nameSize, out TextRange textRange)

Parameters

currentPosition int
localeName System.IntPtr
nameSize int
textRange TextRange

GetLocaleName(int)

Gets the locale name of the text at the specified position.

public string GetLocaleName(int currentPosition)

Parameters

currentPosition int

The position of the text to inspect.

Returns

string

the locale name of the text at the specified position.

GetLocaleNameLength(int, out int, out TextRange)

HRESULT IDWriteTextLayout::GetLocaleNameLength([In] unsigned int currentPosition,[Out] unsigned int* nameLength,[Out, Optional] DWRITE_TEXT_RANGE* textRange)

public void GetLocaleNameLength(int currentPosition, out int nameLength, out TextRange textRange)

Parameters

currentPosition int
nameLength int
textRange TextRange

GetMaxHeight()

float IDWriteTextLayout::GetMaxHeight()

public float GetMaxHeight()

Returns

float

GetMaxWidth()

float IDWriteTextLayout::GetMaxWidth()

public float GetMaxWidth()

Returns

float

GetMetrics(out TextMetrics)

HRESULT IDWriteTextLayout::GetMetrics([Out] DWRITE_TEXT_METRICS* textMetrics)

public void GetMetrics(out TextMetrics textMetrics)

Parameters

textMetrics TextMetrics

GetOverhangMetrics(out OverhangMetrics)

HRESULT IDWriteTextLayout::GetOverhangMetrics([Out] DWRITE_OVERHANG_METRICS* overhangs)

public void GetOverhangMetrics(out OverhangMetrics overhangs)

Parameters

overhangs OverhangMetrics

GetTypography(int, out TextRange)

HRESULT IDWriteTextLayout::GetTypography([In] unsigned int currentPosition,[Out] IDWriteTypography** typography,[Out, Optional] DWRITE_TEXT_RANGE* textRange)

public Typography GetTypography(int currentPosition, out TextRange textRange)

Parameters

currentPosition int
textRange TextRange

Returns

Typography

GetTypography(int)

Gets the typography setting of the text at the specified position.

public Typography GetTypography(int currentPosition)

Parameters

currentPosition int

The position of the text to inspect.

Returns

Typography

a reference to the current typography setting.

HasStrikethrough(int, out TextRange)

HRESULT IDWriteTextLayout::GetStrikethrough([In] unsigned int currentPosition,[Out] BOOL* hasStrikethrough,[Out, Optional] DWRITE_TEXT_RANGE* textRange)

public bool HasStrikethrough(int currentPosition, out TextRange textRange)

Parameters

currentPosition int
textRange TextRange

Returns

bool

HasStrikethrough(int)

Get the strikethrough presence of the text at the specified position.

public bool HasStrikethrough(int currentPosition)

Parameters

currentPosition int

The position of the text to inspect.

Returns

bool

A Boolean flag that indicates whether strikethrough is present at the position indicated by currentPosition.

HasUnderline(int, out TextRange)

HRESULT IDWriteTextLayout::GetUnderline([In] unsigned int currentPosition,[Out] BOOL* hasUnderline,[Out, Optional] DWRITE_TEXT_RANGE* textRange)

public bool HasUnderline(int currentPosition, out TextRange textRange)

Parameters

currentPosition int
textRange TextRange

Returns

bool

HasUnderline(int)

Gets the underline presence of the text at the specified position.

public bool HasUnderline(int currentPosition)

Parameters

currentPosition int

The current text position.

Returns

bool

A Boolean flag that indicates whether underline is present at the position indicated by currentPosition.

HitTestPoint(float, float, out Bool, out Bool)

HRESULT IDWriteTextLayout::HitTestPoint([In] float pointX,[In] float pointY,[Out] BOOL* isTrailingHit,[Out] BOOL* isInside,[Out] DWRITE_HIT_TEST_METRICS* hitTestMetrics)

public HitTestMetrics HitTestPoint(float pointX, float pointY, out Bool isTrailingHit, out Bool isInside)

Parameters

pointX float
pointY float
isTrailingHit Bool
isInside Bool

Returns

HitTestMetrics

HitTestTextPosition(int, Bool, out float, out float)

HRESULT IDWriteTextLayout::HitTestTextPosition([In] unsigned int textPosition,[In] BOOL isTrailingHit,[Out] float* pointX,[Out] float* pointY,[Out] DWRITE_HIT_TEST_METRICS* hitTestMetrics)

public HitTestMetrics HitTestTextPosition(int textPosition, Bool isTrailingHit, out float pointXRef, out float pointYRef)

Parameters

textPosition int
isTrailingHit Bool
pointXRef float
pointYRef float

Returns

HitTestMetrics

HitTestTextRange(int, int, float, float, HitTestMetrics[], int, out int)

HRESULT IDWriteTextLayout::HitTestTextRange([In] unsigned int textPosition,[In] unsigned int textLength,[In] float originX,[In] float originY,[Out, Buffer, Optional] DWRITE_HIT_TEST_METRICS* hitTestMetrics,[In] unsigned int maxHitTestMetricsCount,[Out] unsigned int* actualHitTestMetricsCount)

public HResult HitTestTextRange(int textPosition, int textLength, float originX, float originY, HitTestMetrics[] hitTestMetrics, int maxHitTestMetricsCount, out int actualHitTestMetricsCount)

Parameters

textPosition int
textLength int
originX float
originY float
hitTestMetrics HitTestMetrics[]
maxHitTestMetricsCount int
actualHitTestMetricsCount int

Returns

HResult

HitTestTextRange(int, int, float, float)

The application calls this function to get a set of hit-test metrics corresponding to a range of text positions. One of the main usages is to implement highlight selection of the text string. The function returns E_NOT_SUFFICIENT_BUFFER, which is equivalent to HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER), when the buffer size of hitTestMetrics is too small to hold all the regions calculated by the function. In this situation, the function sets the output value *actualHitTestMetricsCount to the number of geometries calculated. The application is responsible for allocating a new buffer of greater size and calling the function again. A good value to use as an initial value for maxHitTestMetricsCount may be calculated from the following equation: maxHitTestMetricsCount = lineCount * maxBidiReorderingDepth where lineCount is obtained from the value of the output argument *actualLineCount (from the function IDWriteTextLayout::GetLineLengths), and the maxBidiReorderingDepth value from the DWRITE_TEXT_METRICS structure of the output argument *textMetrics (from the function IDWriteFactory::CreateTextLayout).

public HitTestMetrics[] HitTestTextRange(int textPosition, int textLength, float originX, float originY)

Parameters

textPosition int

The first text position of the specified range.

textLength int

The number of positions of the specified range.

originX float

The origin pixel location X at the left of the layout box. This offset is added to the hit-test metrics returned.

originY float

The origin pixel location Y at the top of the layout box. This offset is added to the hit-test metrics returned.

Returns

HitTestMetrics[]

a reference to a buffer of the output geometry fully enclosing the specified position range. The buffer must be at least as large as maxHitTestMetricsCount.

SetDrawingEffect(Brush, TextRange)

Sets the application-defined drawing effect.

public void SetDrawingEffect(Brush brush, TextRange textRange)

Parameters

brush Brush

The color or gradient brush.

textRange TextRange

The text range to which this change applies.

SetDrawingEffect(IntPtr, TextRange)

HRESULT IDWriteTextLayout::SetDrawingEffect([In] void* drawingEffect,[In] DWRITE_TEXT_RANGE textRange)

public void SetDrawingEffect(IntPtr drawingEffect, TextRange textRange)

Parameters

drawingEffect System.IntPtr
textRange TextRange

SetDrawingEffect(object, TextRange)

Sets the application-defined drawing effect.

public IntPtr SetDrawingEffect(object drawingEffect, TextRange textRange)

Parameters

drawingEffect object

Application-defined drawing effects that apply to the range. This data object will be passed back to the application's drawing callbacks for final rendering.

textRange TextRange

The text range to which this change applies.

Returns

System.IntPtr

If the method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

An Brush, such as a color or gradient brush, can be set as a drawing effect if you are using the RenderTarget.DrawTextLayout to draw text and that brush will be used to draw the specified range of text. This drawing effect is associated with the specified range and will be passed back to the application by way of the callback when the range is drawn at drawing time.

SetFontCollection(FontCollection, TextRange)

HRESULT IDWriteTextLayout::SetFontCollection([In] IDWriteFontCollection* fontCollection,[In] DWRITE_TEXT_RANGE textRange)

public void SetFontCollection(FontCollection fontCollection, TextRange textRange)

Parameters

fontCollection FontCollection
textRange TextRange

SetFontFamilyName(string, TextRange)

HRESULT IDWriteTextLayout::SetFontFamilyName([In] const wchar_t* fontFamilyName,[In] DWRITE_TEXT_RANGE textRange)

public void SetFontFamilyName(string fontFamilyName, TextRange textRange)

Parameters

fontFamilyName string
textRange TextRange

SetFontSize(float, TextRange)

HRESULT IDWriteTextLayout::SetFontSize([In] float fontSize,[In] DWRITE_TEXT_RANGE textRange)

public void SetFontSize(float fontSize, TextRange textRange)

Parameters

fontSize float
textRange TextRange

SetFontStretch(FontStretch, TextRange)

HRESULT IDWriteTextLayout::SetFontStretch([In] DWRITE_FONT_STRETCH fontStretch,[In] DWRITE_TEXT_RANGE textRange)

public void SetFontStretch(FontStretch fontStretch, TextRange textRange)

Parameters

fontStretch FontStretch
textRange TextRange

SetFontStyle(FontStyle, TextRange)

HRESULT IDWriteTextLayout::SetFontStyle([In] DWRITE_FONT_STYLE fontStyle,[In] DWRITE_TEXT_RANGE textRange)

public void SetFontStyle(FontStyle fontStyle, TextRange textRange)

Parameters

fontStyle FontStyle
textRange TextRange

SetFontWeight(FontWeight, TextRange)

HRESULT IDWriteTextLayout::SetFontWeight([In] DWRITE_FONT_WEIGHT fontWeight,[In] DWRITE_TEXT_RANGE textRange)

public void SetFontWeight(FontWeight fontWeight, TextRange textRange)

Parameters

fontWeight FontWeight
textRange TextRange

SetInlineObject(IInlineObject, TextRange)

Sets the inline object.

public void SetInlineObject(IInlineObject inlineObject, TextRange textRange)

Parameters

inlineObject IInlineObject

An application-defined inline object.

textRange TextRange

Text range to which this change applies.

Remarks

The application may call this function to specify the set of properties describing an application-defined inline object for specific range. This inline object applies to the specified range and will be passed back to the application by way of the DrawInlineObject callback when the range is drawn. Any text in that range will be suppressed.

SetLocaleName(string, TextRange)

HRESULT IDWriteTextLayout::SetLocaleName([In] const wchar_t* localeName,[In] DWRITE_TEXT_RANGE textRange)

public void SetLocaleName(string localeName, TextRange textRange)

Parameters

localeName string
textRange TextRange

SetMaxHeight(float)

HRESULT IDWriteTextLayout::SetMaxHeight([In] float maxHeight)

public void SetMaxHeight(float maxHeight)

Parameters

maxHeight float

SetMaxWidth(float)

HRESULT IDWriteTextLayout::SetMaxWidth([In] float maxWidth)

public void SetMaxWidth(float maxWidth)

Parameters

maxWidth float

SetStrikethrough(Bool, TextRange)

HRESULT IDWriteTextLayout::SetStrikethrough([In] BOOL hasStrikethrough,[In] DWRITE_TEXT_RANGE textRange)

public void SetStrikethrough(Bool hasStrikethrough, TextRange textRange)

Parameters

hasStrikethrough Bool
textRange TextRange

SetTypography(Typography, TextRange)

HRESULT IDWriteTextLayout::SetTypography([In] IDWriteTypography* typography,[In] DWRITE_TEXT_RANGE textRange)

public void SetTypography(Typography typography, TextRange textRange)

Parameters

typography Typography
textRange TextRange

SetUnderline(Bool, TextRange)

HRESULT IDWriteTextLayout::SetUnderline([In] BOOL hasUnderline,[In] DWRITE_TEXT_RANGE textRange)

public void SetUnderline(Bool hasUnderline, TextRange textRange)

Parameters

hasUnderline Bool
textRange TextRange

Operators

explicit operator TextLayout(IntPtr)

Performs an explicit conversion from System.IntPtr to TextLayout.

public static explicit operator TextLayout(IntPtr nativePointer)

Parameters

nativePointer System.IntPtr

Returns

TextLayout