Skip to content

Latest commit

 

History

History
220 lines (143 loc) · 6.2 KB

cd2dtextformat-class.md

File metadata and controls

220 lines (143 loc) · 6.2 KB
descriptiontitlems.datef1_keywordshelpviewer_keywordsms.assetid
Learn more about: CD2DTextFormat Class
CD2DTextFormat Class
03/27/2019
CD2DTextFormat
AFXRENDERTARGET/CD2DTextFormat
AFXRENDERTARGET/CD2DTextFormat::CD2DTextFormat
AFXRENDERTARGET/CD2DTextFormat::Create
AFXRENDERTARGET/CD2DTextFormat::Destroy
AFXRENDERTARGET/CD2DTextFormat::Get
AFXRENDERTARGET/CD2DTextFormat::GetFontFamilyName
AFXRENDERTARGET/CD2DTextFormat::GetLocaleName
AFXRENDERTARGET/CD2DTextFormat::IsValid
AFXRENDERTARGET/CD2DTextFormat::ReCreate
AFXRENDERTARGET/CD2DTextFormat::m_pTextFormat
CD2DTextFormat [MFC], CD2DTextFormat
CD2DTextFormat [MFC], Create
CD2DTextFormat [MFC], Destroy
CD2DTextFormat [MFC], Get
CD2DTextFormat [MFC], GetFontFamilyName
CD2DTextFormat [MFC], GetLocaleName
CD2DTextFormat [MFC], IsValid
CD2DTextFormat [MFC], ReCreate
CD2DTextFormat [MFC], m_pTextFormat
db194cec-9dae-4644-ab84-7c43b7164117

CD2DTextFormat Class

A wrapper for IDWriteTextFormat.

Syntax

class CD2DTextFormat : public CD2DResource; 

Members

Public Constructors

NameDescription
CD2DTextFormat::CD2DTextFormatConstructs a CD2DTextFormat object.
CD2DTextFormat::~CD2DTextFormatThe destructor. Called when a D2D text format object is being destroyed.

Public Methods

NameDescription
CD2DTextFormat::CreateCreates a CD2DTextFormat. (Overrides CD2DResource::Create.)
CD2DTextFormat::DestroyDestroys a CD2DTextFormat object. (Overrides CD2DResource::Destroy.)
CD2DTextFormat::GetReturns IDWriteTextFormat interface
CD2DTextFormat::GetFontFamilyNameGets a copy of the font family name.
CD2DTextFormat::GetLocaleNameGets a copy of the locale name.
CD2DTextFormat::IsValidChecks resource validity (Overrides CD2DResource::IsValid.)
CD2DTextFormat::ReCreateRe-creates a CD2DTextFormat. (Overrides CD2DResource::ReCreate.)

Public Operators

NameDescription
CD2DTextFormat::operator IDWriteTextFormat*Returns IDWriteTextFormat interface

Protected Data Members

NameDescription
CD2DTextFormat::m_pTextFormatA pointer to an IDWriteTextFormat.

Inheritance Hierarchy

CObject

CD2DResource

CD2DTextFormat

Requirements

Header: afxrendertarget.h

CD2DTextFormat::~CD2DTextFormat

The destructor. Called when a D2D text format object is being destroyed.

virtual ~CD2DTextFormat(); 

CD2DTextFormat::CD2DTextFormat

Constructs a CD2DTextFormat object.

CD2DTextFormat( CRenderTarget* pParentTarget, const CString& strFontFamilyName, FLOAT fontSize, DWRITE_FONT_WEIGHT fontWeight = DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE fontStyle = DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH fontStretch = DWRITE_FONT_STRETCH_NORMAL, const CString& strFontLocale = _T(""), IDWriteFontCollection* pFontCollection = NULL, BOOL bAutoDestroy = TRUE); 

Parameters

pParentTarget
A pointer to the render target.

strFontFamilyName
A CString object that contains the name of the font family.

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

fontWeight
A value that indicates the font weight for the text object.

fontStyle
A value that indicates the font style for the text object.

fontStretch
A value that indicates the font stretch for the text object.

strFontLocale
A CString object that contains the locale name.

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

bAutoDestroy
Indicates that the object will be destroyed by owner (pParentTarget).

CD2DTextFormat::Create

Creates a CD2DTextFormat.

virtual HRESULT Create(CRenderTarget* */); 

Return Value

If the method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

CD2DTextFormat::Destroy

Destroys a CD2DTextFormat object.

virtual void Destroy(); 

CD2DTextFormat::Get

Returns IDWriteTextFormat interface

IDWriteTextFormat* Get(); 

Return Value

Pointer to an IDWriteTextFormat interface or NULL if object is not initialized yet.

CD2DTextFormat::GetFontFamilyName

Gets a copy of the font family name.

CString GetFontFamilyName() const; 

Return Value

CString object that contains the current font family name.

CD2DTextFormat::GetLocaleName

Gets a copy of the locale name.

CString GetLocaleName() const; 

Return Value

CString object that contains the current locale name.

CD2DTextFormat::IsValid

Checks resource validity

virtual BOOL IsValid() const; 

Return Value

TRUE if resource is valid; otherwise FALSE.

CD2DTextFormat::m_pTextFormat

A pointer to an IDWriteTextFormat.

IDWriteTextFormat* m_pTextFormat; 

CD2DTextFormat::operator IDWriteTextFormat*

Returns IDWriteTextFormat interface

operator IDWriteTextFormat*(); 

Return Value

Pointer to an IDWriteTextFormat interface or NULL if object is not initialized yet.

CD2DTextFormat::ReCreate

Re-creates a CD2DTextFormat.

virtual HRESULT ReCreate(CRenderTarget* */); 

Return Value

If the method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

See also

Classes

close