[]
        
(Showing Draft Content)

GrapeCity.Documents.DX.DirectWrite.TextLayout1

Class TextLayout1

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

IDWriteTextLayout1

[Guid("9064D822-80A7-465C-A986-DF65F78B8FEB")]
public class TextLayout1 : TextLayout, IDisposable, IUnknown
Inheritance
object
TextLayout1
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

TextLayout1(IntPtr)

Initializes a new instance of the TextLayout1 class.

public TextLayout1(IntPtr nativePtr)

Parameters

nativePtr System.IntPtr

The native pointer.

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

TextLayout1

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

TextLayout1

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 TextLayout1 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 TextLayout1 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

TextLayout1

GetCharacterSpacing(int, out float, out float, out float, out TextRange)

HRESULT IDWriteTextLayout1::GetCharacterSpacing([In] unsigned int currentPosition,[Out] float* leadingSpacing,[Out] float* trailingSpacing,[Out] float* minimumAdvanceWidth,[Out, Optional] DWRITE_TEXT_RANGE* textRange)

public void GetCharacterSpacing(int currentPosition, out float leadingSpacing, out float trailingSpacing, out float minimumAdvanceWidth, out TextRange textRange)

Parameters

currentPosition int
leadingSpacing float
trailingSpacing float
minimumAdvanceWidth float
textRange TextRange

GetPairKerning(int, out Bool, out TextRange)

HRESULT IDWriteTextLayout1::GetPairKerning([In] unsigned int currentPosition,[Out] BOOL* isPairKerningEnabled,[Out, Optional] DWRITE_TEXT_RANGE* textRange)

public void GetPairKerning(int currentPosition, out Bool isPairKerningEnabled, out TextRange textRange)

Parameters

currentPosition int
isPairKerningEnabled Bool
textRange TextRange

SetCharacterSpacing(float, float, float, TextRange)

HRESULT IDWriteTextLayout1::SetCharacterSpacing([In] float leadingSpacing,[In] float trailingSpacing,[In] float minimumAdvanceWidth,[In] DWRITE_TEXT_RANGE textRange)

public void SetCharacterSpacing(float leadingSpacing, float trailingSpacing, float minimumAdvanceWidth, TextRange textRange)

Parameters

leadingSpacing float
trailingSpacing float
minimumAdvanceWidth float
textRange TextRange

SetPairKerning(Bool, TextRange)

HRESULT IDWriteTextLayout1::SetPairKerning([In] BOOL isPairKerningEnabled,[In] DWRITE_TEXT_RANGE textRange)

public void SetPairKerning(Bool isPairKerningEnabled, TextRange textRange)

Parameters

isPairKerningEnabled Bool
textRange TextRange

Operators

explicit operator TextLayout1(IntPtr)

Performs an explicit conversion from System.IntPtr to TextLayout1.

public static explicit operator TextLayout1(IntPtr nativePointer)

Parameters

nativePointer System.IntPtr

Returns

TextLayout1