description | title | ms.date | f1_keywords | helpviewer_keywords | ms.assetid | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Learn more about: CD2DTextFormat Class |
CD2DTextFormat Class |
03/27/2019 |
|
|
db194cec-9dae-4644-ab84-7c43b7164117 |
A wrapper for IDWriteTextFormat.
class CD2DTextFormat : public CD2DResource;
Name | Description |
---|---|
CD2DTextFormat::CD2DTextFormat | Constructs a CD2DTextFormat object. |
CD2DTextFormat::~CD2DTextFormat | The destructor. Called when a D2D text format object is being destroyed. |
Name | Description |
---|---|
CD2DTextFormat::Create | Creates a CD2DTextFormat. (Overrides CD2DResource::Create.) |
CD2DTextFormat::Destroy | Destroys a CD2DTextFormat object. (Overrides CD2DResource::Destroy.) |
CD2DTextFormat::Get | Returns IDWriteTextFormat interface |
CD2DTextFormat::GetFontFamilyName | Gets a copy of the font family name. |
CD2DTextFormat::GetLocaleName | Gets a copy of the locale name. |
CD2DTextFormat::IsValid | Checks resource validity (Overrides CD2DResource::IsValid.) |
CD2DTextFormat::ReCreate | Re-creates a CD2DTextFormat. (Overrides CD2DResource::ReCreate.) |
Name | Description |
---|---|
CD2DTextFormat::operator IDWriteTextFormat* | Returns IDWriteTextFormat interface |
Name | Description |
---|---|
CD2DTextFormat::m_pTextFormat | A pointer to an IDWriteTextFormat. |
Header: afxrendertarget.h
The destructor. Called when a D2D text format object is being destroyed.
virtual ~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);
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).
Creates a CD2DTextFormat.
virtual HRESULT Create(CRenderTarget* */);
If the method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
Destroys a CD2DTextFormat object.
virtual void Destroy();
Returns IDWriteTextFormat interface
IDWriteTextFormat* Get();
Pointer to an IDWriteTextFormat interface or NULL if object is not initialized yet.
Gets a copy of the font family name.
CString GetFontFamilyName() const;
CString object that contains the current font family name.
Gets a copy of the locale name.
CString GetLocaleName() const;
CString object that contains the current locale name.
Checks resource validity
virtual BOOL IsValid() const;
TRUE if resource is valid; otherwise FALSE.
A pointer to an IDWriteTextFormat.
IDWriteTextFormat* m_pTextFormat;
Returns IDWriteTextFormat interface
operator IDWriteTextFormat*();
Pointer to an IDWriteTextFormat interface or NULL if object is not initialized yet.
Re-creates a CD2DTextFormat.
virtual HRESULT ReCreate(CRenderTarget* */);
If the method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.