[]
        
(Showing Draft Content)

GrapeCity.Documents.DX.DirectWrite.TextFormat

Class TextFormat

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

IDWriteTextFormat

[Guid("9c906818-31d7-4fd3-a151-7c5e225db55a")]
public class TextFormat : ComObject, IDisposable, IUnknown
Inheritance
object
TextFormat
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

TextFormat(IntPtr)

Initializes a new instance of the TextFormat class.

public TextFormat(IntPtr nativePtr)

Parameters

nativePtr System.IntPtr

The native pointer.

Properties

FontFamilyName

Gets a copy of the font family name.

public string FontFamilyName { get; }

Property Value

string

the current font family name.

LocaleName

Gets a copy of the locale name.

public string LocaleName { get; }

Property Value

string

the current locale name.

Methods

Create(Factory, string, FontCollection, FontWeight, FontStyle, FontStretch, float, string)

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)

Parameters

factory Factory

an instance of Factory

fontFamilyName string

An array of characters that contains the name of the font family

fontCollection FontCollection

A pointer to a font collection object. When this is NULL, indicates the system font collection.

fontWeight FontWeight

A value that indicates the font weight for the text object created by this method.

fontStyle FontStyle

A value that indicates the font style for the text object created by this method.

fontStretch FontStretch

A value that indicates the font stretch for the text object created by this method.

fontSize float

The logical size of the font in DIP ("device-independent pixel") units. A DIP equals 1/96 inch.

localeName string

An array of characters that contains the locale name.

Returns

TextFormat

Create(Factory, string, FontCollection, FontWeight, FontStyle, FontStretch, float)

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)

Parameters

factory Factory

an instance of Factory

fontFamilyName string

An array of characters that contains the name of the font family

fontCollection FontCollection

A pointer to a font collection object. When this is NULL, indicates the system font collection.

fontWeight FontWeight

A value that indicates the font weight for the text object created by this method.

fontStyle FontStyle

A value that indicates the font style for the text object created by this method.

fontStretch FontStretch

A value that indicates the font stretch for the text object created by this method.

fontSize float

The logical size of the font in DIP ("device-independent pixel") units. A DIP equals 1/96 inch.

Returns

TextFormat

Create(Factory, string, FontWeight, FontStyle, FontStretch, float)

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)

Parameters

factory Factory

an instance of Factory

fontFamilyName string

An array of characters that contains the name of the font family

fontWeight FontWeight

A value that indicates the font weight for the text object created by this method.

fontStyle FontStyle

A value that indicates the font style for the text object created by this method.

fontStretch FontStretch

A value that indicates the font stretch for the text object created by this method.

fontSize float

The logical size of the font in DIP ("device-independent pixel") units. A DIP equals 1/96 inch.

Returns

TextFormat

Create(Factory, string, FontWeight, FontStyle, float)

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)

Parameters

factory Factory

an instance of Factory

fontFamilyName string

An array of characters that contains the name of the font family

fontWeight FontWeight

A value that indicates the font weight for the text object created by this method.

fontStyle FontStyle

A value that indicates the font style for the text object created by this method.

fontSize float

The logical size of the font in DIP ("device-independent pixel") units. A DIP equals 1/96 inch.

Returns

TextFormat

Create(Factory, string, float)

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)

Parameters

factory Factory

an instance of Factory

fontFamilyName string

An array of characters that contains the name of the font family

fontSize float

The logical size of the font in DIP ("device-independent pixel") units. A DIP equals 1/96 inch.

Returns

TextFormat

GetFlowDirection()

DWRITE_FLOW_DIRECTION IDWriteTextFormat::GetFlowDirection()

public FlowDirection GetFlowDirection()

Returns

FlowDirection

GetFontCollection()

HRESULT IDWriteTextFormat::GetFontCollection([Out] IDWriteFontCollection** fontCollection)

public FontCollection GetFontCollection()

Returns

FontCollection

GetFontFamilyName(IntPtr, int)

HRESULT IDWriteTextFormat::GetFontFamilyName([Out, Buffer] wchar_t* fontFamilyName,[In] unsigned int nameSize)

public void GetFontFamilyName(IntPtr fontFamilyName, int nameSize)

Parameters

fontFamilyName System.IntPtr
nameSize int

GetFontFamilyNameLength()

unsigned int IDWriteTextFormat::GetFontFamilyNameLength()

public int GetFontFamilyNameLength()

Returns

int

GetFontSize()

float IDWriteTextFormat::GetFontSize()

public float GetFontSize()

Returns

float

GetFontStretch()

DWRITE_FONT_STRETCH IDWriteTextFormat::GetFontStretch()

public FontStretch GetFontStretch()

Returns

FontStretch

GetFontStyle()

DWRITE_FONT_STYLE IDWriteTextFormat::GetFontStyle()

public FontStyle GetFontStyle()

Returns

FontStyle

GetFontWeight()

DWRITE_FONT_WEIGHT IDWriteTextFormat::GetFontWeight()

public FontWeight GetFontWeight()

Returns

FontWeight

GetIncrementalTabStop()

float IDWriteTextFormat::GetIncrementalTabStop()

public float GetIncrementalTabStop()

Returns

float

GetLineSpacing(out LineSpacingMethod, out float, out float)

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)

Parameters

lineSpacingMethod LineSpacingMethod
lineSpacing float
baseline float

GetLocaleName(IntPtr, int)

HRESULT IDWriteTextFormat::GetLocaleName([Out, Buffer] wchar_t* localeName,[In] unsigned int nameSize)

public void GetLocaleName(IntPtr localeName, int nameSize)

Parameters

localeName System.IntPtr
nameSize int

GetLocaleNameLength()

unsigned int IDWriteTextFormat::GetLocaleNameLength()

public int GetLocaleNameLength()

Returns

int

GetParagraphAlignment()

DWRITE_PARAGRAPH_ALIGNMENT IDWriteTextFormat::GetParagraphAlignment()

public ParagraphAlignment GetParagraphAlignment()

Returns

ParagraphAlignment

GetReadingDirection()

DWRITE_READING_DIRECTION IDWriteTextFormat::GetReadingDirection()

public ReadingDirection GetReadingDirection()

Returns

ReadingDirection

GetTextAlignment()

DWRITE_TEXT_ALIGNMENT IDWriteTextFormat::GetTextAlignment()

public TextAlignment GetTextAlignment()

Returns

TextAlignment

GetTrimming(out Trimming, out IInlineObject)

HRESULT IDWriteTextFormat::GetTrimming([Out] DWRITE_TRIMMING* trimmingOptions,[Out] IDWriteInlineObject** trimmingSign)

public void GetTrimming(out Trimming trimmingOptions, out IInlineObject trimmingSign)

Parameters

trimmingOptions Trimming
trimmingSign IInlineObject

GetWordWrapping()

DWRITE_WORD_WRAPPING IDWriteTextFormat::GetWordWrapping()

public WordWrapping GetWordWrapping()

Returns

WordWrapping

SetFlowDirection(FlowDirection)

HRESULT IDWriteTextFormat::SetFlowDirection([In] DWRITE_FLOW_DIRECTION flowDirection)

public void SetFlowDirection(FlowDirection flowDirection)

Parameters

flowDirection FlowDirection

SetIncrementalTabStop(float)

HRESULT IDWriteTextFormat::SetIncrementalTabStop([In] float incrementalTabStop)

public void SetIncrementalTabStop(float incrementalTabStop)

Parameters

incrementalTabStop float

SetLineSpacing(LineSpacingMethod, float, float)

HRESULT IDWriteTextFormat::SetLineSpacing([In] DWRITE_LINE_SPACING_METHOD lineSpacingMethod,[In] float lineSpacing,[In] float baseline)

public void SetLineSpacing(LineSpacingMethod lineSpacingMethod, float lineSpacing, float baseline)

Parameters

lineSpacingMethod LineSpacingMethod
lineSpacing float
baseline float

SetParagraphAlignment(ParagraphAlignment)

HRESULT IDWriteTextFormat::SetParagraphAlignment([In] DWRITE_PARAGRAPH_ALIGNMENT paragraphAlignment)

public void SetParagraphAlignment(ParagraphAlignment paragraphAlignment)

Parameters

paragraphAlignment ParagraphAlignment

SetReadingDirection(ReadingDirection)

HRESULT IDWriteTextFormat::SetReadingDirection([In] DWRITE_READING_DIRECTION readingDirection)

public void SetReadingDirection(ReadingDirection readingDirection)

Parameters

readingDirection ReadingDirection

SetTextAlignment(TextAlignment)

HRESULT IDWriteTextFormat::SetTextAlignment([In] DWRITE_TEXT_ALIGNMENT textAlignment)

public void SetTextAlignment(TextAlignment textAlignment)

Parameters

textAlignment TextAlignment

SetTrimming(Trimming, IInlineObject)

Sets trimming options for text overflowing the layout width.

public void SetTrimming(Trimming trimmingOptions, IInlineObject trimmingSign)

Parameters

trimmingOptions Trimming

Text trimming options.

trimmingSign IInlineObject

Application-defined omission sign. This parameter may be null. See IInlineObject for more information.

SetWordWrapping(WordWrapping)

HRESULT IDWriteTextFormat::SetWordWrapping([In] DWRITE_WORD_WRAPPING wordWrapping)

public void SetWordWrapping(WordWrapping wordWrapping)

Parameters

wordWrapping WordWrapping

Operators

explicit operator TextFormat(IntPtr)

Performs an explicit conversion from System.IntPtr to TextFormat.

public static explicit operator TextFormat(IntPtr nativePointer)

Parameters

nativePointer System.IntPtr

Returns

TextFormat