[]
IDWriteTextFormat
[Guid("9c906818-31d7-4fd3-a151-7c5e225db55a")]
public class TextFormat : ComObject, IDisposable, IUnknown
Initializes a new instance of the TextFormat class.
public TextFormat(IntPtr nativePtr)
nativePtr System.IntPtrThe native pointer.
Gets a copy of the font family name.
public string FontFamilyName { get; }
the current font family name.
Gets a copy of the locale name.
public string LocaleName { get; }
the current locale name.
Creates a text format object used for text layout.
public static TextFormat Create(Factory factory, string fontFamilyName, FontCollection fontCollection, FontWeight fontWeight, FontStyle fontStyle, FontStretch fontStretch, float fontSize, string localeName)
factory Factoryan instance of Factory
fontFamilyName stringAn array of characters that contains the name of the font family
fontCollection FontCollectionA pointer to a font collection object. When this is NULL, indicates the system font collection.
fontWeight FontWeightA value that indicates the font weight for the text object created by this method.
fontStyle FontStyleA value that indicates the font style for the text object created by this method.
fontStretch FontStretchA value that indicates the font stretch for the text object created by this method.
fontSize floatThe logical size of the font in DIP ("device-independent pixel") units. A DIP equals 1/96 inch.
localeName stringAn array of characters that contains the locale name.
Creates a text format object used for text layout.
public static TextFormat Create(Factory factory, string fontFamilyName, FontCollection fontCollection, FontWeight fontWeight, FontStyle fontStyle, FontStretch fontStretch, float fontSize)
factory Factoryan instance of Factory
fontFamilyName stringAn array of characters that contains the name of the font family
fontCollection FontCollectionA pointer to a font collection object. When this is NULL, indicates the system font collection.
fontWeight FontWeightA value that indicates the font weight for the text object created by this method.
fontStyle FontStyleA value that indicates the font style for the text object created by this method.
fontStretch FontStretchA value that indicates the font stretch for the text object created by this method.
fontSize floatThe logical size of the font in DIP ("device-independent pixel") units. A DIP equals 1/96 inch.
Creates a text format object used for text layout.
public static TextFormat Create(Factory factory, string fontFamilyName, FontWeight fontWeight, FontStyle fontStyle, FontStretch fontStretch, float fontSize)
factory Factoryan instance of Factory
fontFamilyName stringAn array of characters that contains the name of the font family
fontWeight FontWeightA value that indicates the font weight for the text object created by this method.
fontStyle FontStyleA value that indicates the font style for the text object created by this method.
fontStretch FontStretchA value that indicates the font stretch for the text object created by this method.
fontSize floatThe logical size of the font in DIP ("device-independent pixel") units. A DIP equals 1/96 inch.
Creates a text format object used for text layout with normal stretch.
public static TextFormat Create(Factory factory, string fontFamilyName, FontWeight fontWeight, FontStyle fontStyle, float fontSize)
factory Factoryan instance of Factory
fontFamilyName stringAn array of characters that contains the name of the font family
fontWeight FontWeightA value that indicates the font weight for the text object created by this method.
fontStyle FontStyleA value that indicates the font style for the text object created by this method.
fontSize floatThe logical size of the font in DIP ("device-independent pixel") units. A DIP equals 1/96 inch.
Creates a text format object used for text layout with normal weight, style and stretch.
public static TextFormat Create(Factory factory, string fontFamilyName, float fontSize)
factory Factoryan instance of Factory
fontFamilyName stringAn array of characters that contains the name of the font family
fontSize floatThe logical size of the font in DIP ("device-independent pixel") units. A DIP equals 1/96 inch.
DWRITE_FLOW_DIRECTION IDWriteTextFormat::GetFlowDirection()
public FlowDirection GetFlowDirection()
HRESULT IDWriteTextFormat::GetFontCollection([Out] IDWriteFontCollection** fontCollection)
public FontCollection GetFontCollection()
HRESULT IDWriteTextFormat::GetFontFamilyName([Out, Buffer] wchar_t* fontFamilyName,[In] unsigned int nameSize)
public void GetFontFamilyName(IntPtr fontFamilyName, int nameSize)
fontFamilyName System.IntPtrnameSize intunsigned int IDWriteTextFormat::GetFontFamilyNameLength()
public int GetFontFamilyNameLength()
float IDWriteTextFormat::GetFontSize()
public float GetFontSize()
DWRITE_FONT_STRETCH IDWriteTextFormat::GetFontStretch()
public FontStretch GetFontStretch()
DWRITE_FONT_STYLE IDWriteTextFormat::GetFontStyle()
public FontStyle GetFontStyle()
DWRITE_FONT_WEIGHT IDWriteTextFormat::GetFontWeight()
public FontWeight GetFontWeight()
float IDWriteTextFormat::GetIncrementalTabStop()
public float GetIncrementalTabStop()
HRESULT IDWriteTextFormat::GetLineSpacing([Out] DWRITE_LINE_SPACING_METHOD* lineSpacingMethod,[Out] float* lineSpacing,[Out] float* baseline)
public void GetLineSpacing(out LineSpacingMethod lineSpacingMethod, out float lineSpacing, out float baseline)
lineSpacingMethod LineSpacingMethodlineSpacing floatbaseline floatHRESULT IDWriteTextFormat::GetLocaleName([Out, Buffer] wchar_t* localeName,[In] unsigned int nameSize)
public void GetLocaleName(IntPtr localeName, int nameSize)
localeName System.IntPtrnameSize intunsigned int IDWriteTextFormat::GetLocaleNameLength()
public int GetLocaleNameLength()
DWRITE_PARAGRAPH_ALIGNMENT IDWriteTextFormat::GetParagraphAlignment()
public ParagraphAlignment GetParagraphAlignment()
DWRITE_READING_DIRECTION IDWriteTextFormat::GetReadingDirection()
public ReadingDirection GetReadingDirection()
DWRITE_TEXT_ALIGNMENT IDWriteTextFormat::GetTextAlignment()
public TextAlignment GetTextAlignment()
HRESULT IDWriteTextFormat::GetTrimming([Out] DWRITE_TRIMMING* trimmingOptions,[Out] IDWriteInlineObject** trimmingSign)
public void GetTrimming(out Trimming trimmingOptions, out IInlineObject trimmingSign)
trimmingOptions TrimmingtrimmingSign IInlineObjectDWRITE_WORD_WRAPPING IDWriteTextFormat::GetWordWrapping()
public WordWrapping GetWordWrapping()
HRESULT IDWriteTextFormat::SetFlowDirection([In] DWRITE_FLOW_DIRECTION flowDirection)
public void SetFlowDirection(FlowDirection flowDirection)
flowDirection FlowDirectionHRESULT IDWriteTextFormat::SetIncrementalTabStop([In] float incrementalTabStop)
public void SetIncrementalTabStop(float incrementalTabStop)
incrementalTabStop floatHRESULT IDWriteTextFormat::SetLineSpacing([In] DWRITE_LINE_SPACING_METHOD lineSpacingMethod,[In] float lineSpacing,[In] float baseline)
public void SetLineSpacing(LineSpacingMethod lineSpacingMethod, float lineSpacing, float baseline)
lineSpacingMethod LineSpacingMethodlineSpacing floatbaseline floatHRESULT IDWriteTextFormat::SetParagraphAlignment([In] DWRITE_PARAGRAPH_ALIGNMENT paragraphAlignment)
public void SetParagraphAlignment(ParagraphAlignment paragraphAlignment)
paragraphAlignment ParagraphAlignmentHRESULT IDWriteTextFormat::SetReadingDirection([In] DWRITE_READING_DIRECTION readingDirection)
public void SetReadingDirection(ReadingDirection readingDirection)
readingDirection ReadingDirectionHRESULT IDWriteTextFormat::SetTextAlignment([In] DWRITE_TEXT_ALIGNMENT textAlignment)
public void SetTextAlignment(TextAlignment textAlignment)
textAlignment TextAlignmentSets trimming options for text overflowing the layout width.
public void SetTrimming(Trimming trimmingOptions, IInlineObject trimmingSign)
trimmingOptions TrimmingText trimming options.
trimmingSign IInlineObjectApplication-defined omission sign. This parameter may be null. See IInlineObject for more information.
HRESULT IDWriteTextFormat::SetWordWrapping([In] DWRITE_WORD_WRAPPING wordWrapping)
public void SetWordWrapping(WordWrapping wordWrapping)
wordWrapping WordWrappingPerforms an explicit conversion from System.IntPtr to TextFormat.
public static explicit operator TextFormat(IntPtr nativePointer)
nativePointer System.IntPtr