[]
IDWriteTextLayout1
[Guid("9064D822-80A7-465C-A986-DF65F78B8FEB")]
public class TextLayout1 : TextLayout, IDisposable, IUnknown
Initializes a new instance of the TextLayout1 class.
public TextLayout1(IntPtr nativePtr)
nativePtr
System.IntPtrThe native pointer.
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)
factory
Factoryan instance of Factory
text
stringAn 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
TextFormatThe text formatting object to apply to the string.
layoutWidth
floatThe width of the layout box.
layoutHeight
floatThe height of the layout box.
pixelsPerDip
floatThe 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
boolInstructs 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.
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 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)
factory
Factoryan instance of Factory
text
stringAn 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
TextFormatThe text formatting object to apply to the string.
layoutWidth
floatThe width of the layout box.
layoutHeight
floatThe height of the layout box.
pixelsPerDip
floatThe 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
boolInstructs 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.
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.
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)
factory
Factoryan instance of Factory
text
stringAn 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
TextFormatA pointer to an object that indicates the format to apply to the string.
maxWidth
floatThe width of the layout box.
maxHeight
floatThe height of the layout box.
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)
currentPosition
intleadingSpacing
floattrailingSpacing
floatminimumAdvanceWidth
floattextRange
TextRangeHRESULT 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)
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)
leadingSpacing
floattrailingSpacing
floatminimumAdvanceWidth
floattextRange
TextRangeHRESULT IDWriteTextLayout1::SetPairKerning([In] BOOL isPairKerningEnabled,[In] DWRITE_TEXT_RANGE textRange)
public void SetPairKerning(Bool isPairKerningEnabled, TextRange textRange)
Performs an explicit conversion from System.IntPtr to TextLayout1.
public static explicit operator TextLayout1(IntPtr nativePointer)
nativePointer
System.IntPtr