[]
        
(Showing Draft Content)

C1.Util.DX.DirectWrite.TextLayout

TextLayout Class

IDWriteTextLayout

Implements
Namespace: C1.Util.DX.DirectWrite
Assembly: C1.Win.C1DX.4.8.dll
Syntax
[Guid("53737037-6d14-410b-9bfe-0b182bb70961")]
public class TextLayout : TextFormat, IDisposable, IUnknown

Constructors

Name Description
TextLayout(IntPtr)

Initializes a new instance of the TextLayout class.

Properties

Name Description
Metrics

GetMetrics

OverhangMetrics

GetOverhangMetrics

Methods

Name Description
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.

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.

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.

DetermineMinWidth()

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

Draw(TextRenderer, float, float)

Draws text using the specified client drawing context.

Draw(object, TextRenderer, float, float)

Draws text using the specified client drawing context.

GetClusterMetrics()

Retrieves logical properties and measurements of each glyph cluster.

GetClusterMetrics(ClusterMetrics[], int, out int)

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

GetDrawingEffect(int)

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

GetDrawingEffect(int, out TextRange)

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

GetFontCollection(int)

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

GetFontCollection(int, out TextRange)

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

GetFontFamilyName(int)

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

GetFontFamilyName(int, out TextRange)

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

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)

GetFontFamilyNameLength(int, out int, out TextRange)

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

GetFontSize(int)

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

GetFontSize(int, out TextRange)

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

GetFontStretch(int)

Gets the font stretch 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)

GetFontStyle(int)

Gets the font style (also known as slope) of the text 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)

GetFontWeight(int)

Gets the font weight of the text 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)

GetInlineObject(int)

Gets the inline object at the specified position.

GetInlineObject(int, out TextRange)

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

GetLineMetrics()

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

GetLineMetrics(LineMetrics[], int, out int)

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

GetLocaleName(int)

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

GetLocaleName(int, out TextRange)

Gets 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)

GetLocaleNameLength(int, out int, out TextRange)

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

GetMaxHeight()

float IDWriteTextLayout::GetMaxHeight()

GetMaxWidth()

float IDWriteTextLayout::GetMaxWidth()

GetMetrics(out TextMetrics)

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

GetOverhangMetrics(out OverhangMetrics)

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

GetTypography(int)

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

GetTypography(int, out TextRange)

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

HasStrikethrough(int)

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

HasStrikethrough(int, out TextRange)

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

HasUnderline(int)

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

HasUnderline(int, out TextRange)

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

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)

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)

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).

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)

SetDrawingEffect(Brush, TextRange)

Sets the application-defined drawing effect.

SetDrawingEffect(IntPtr, TextRange)

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

SetDrawingEffect(object, TextRange)

Sets the application-defined drawing effect.

SetFontCollection(FontCollection, TextRange)

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

SetFontFamilyName(string, TextRange)

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

SetFontSize(float, TextRange)

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

SetFontStretch(FontStretch, TextRange)

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

SetFontStyle(FontStyle, TextRange)

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

SetFontWeight(FontWeight, TextRange)

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

SetInlineObject(InlineObject, TextRange)

Sets the inline object.

SetLocaleName(string, TextRange)

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

SetMaxHeight(float)

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

SetMaxWidth(float)

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

SetStrikethrough(Bool, TextRange)

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

SetTypography(Typography, TextRange)

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

SetUnderline(Bool, TextRange)

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

Operators

Name Description
explicit operator TextLayout(IntPtr)

Performs an explicit conversion from IntPtr to TextLayout.