共用方式為


CD2DTextFormat 類別

IDWriteTextFormat 的包裝函式。

語法

class CD2DTextFormat : public CD2DResource;

成員

公用建構函式

名稱 描述
CD2DTextFormat::CD2DTextFormat 建構 CD2DTextFormat 物件。
CD2DTextFormat::~CD2DTextFormat 解構函式。 當 D2D 文字格式物件被終結時呼叫。

公用方法

名稱 描述
CD2DTextFormat::Create 建立 CD2DTextFormat。 (覆寫 CD2DResource::Create .)
CD2DTextFormat::D estroy 終結 CD2DTextFormat 物件。 (覆寫 CD2DResource::D estroy .)
CD2DTextFormat::Get 傳回 IDWriteTextFormat 介面
CD2DTextFormat::GetFontFamilyName 取得字型系列名稱的複本。
CD2DTextFormat::GetLocaleName 取得地區設定名稱的複本。
CD2DTextFormat::IsValid 檢查資源有效性 (覆寫 CD2DResource::IsValid .)
CD2DTextFormat::ReCreate 重新建立 CD2DTextFormat。 (覆寫 CD2DResource::ReCreate .)

公用運算子

名稱 描述
CD2DTextFormat::operator IDWriteTextFormat* 傳回 IDWriteTextFormat 介面

受保護的資料成員

名稱 描述
CD2DTextFormat::m_pTextFormat IDWriteTextFormat 的指標。

繼承階層架構

CObject

CD2DResource

CD2DTextFormat

需求

標頭: afxrendertarget.h

CD2DTextFormat::~CD2DTextFormat

解構函式。 當 D2D 文字格式物件被終結時呼叫。

virtual ~CD2DTextFormat();

CD2DTextFormat::CD2DTextFormat

建構 CD2DTextFormat 物件。

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
轉譯目標的指標。

strFontFamilyName
包含字型系列名稱的 CString 物件。

fontSize
DIP 中字型的邏輯大小(「裝置獨立圖元」) 單位。 DIPequals 1/96 英吋。

fontWeight
值,表示文字物件的字型粗細。

fontStyle
值,表示文字物件的字型樣式。

fontStretch
值,表示文字物件的字型延展。

strFontLocale
包含地區設定名稱的 CString 物件。

pFontCollection
字型集合物件的指標。 當這是 Null 時,表示系統字型集合。

bAutoDestroy
表示物件將會由擁有者終結(pParentTarget)。

CD2DTextFormat::Create

建立 CD2DTextFormat。

virtual HRESULT Create(CRenderTarget* */);

傳回值

如果方法成功,則會傳回S_OK。 否則,它會傳回 HRESULT 錯誤碼。

CD2DTextFormat::D estroy

終結 CD2DTextFormat 物件。

virtual void Destroy();

CD2DTextFormat::Get

傳回 IDWriteTextFormat 介面

IDWriteTextFormat* Get();

傳回值

如果物件尚未初始化,則為 IDWriteTextFormat 介面的指標或 Null。

CD2DTextFormat::GetFontFamilyName

取得字型系列名稱的複本。

CString GetFontFamilyName() const;

傳回值

包含目前字型系列名稱的 CString 物件。

CD2DTextFormat::GetLocaleName

取得地區設定名稱的複本。

CString GetLocaleName() const;

傳回值

包含目前地區設定名稱的 CString 物件。

CD2DTextFormat::IsValid

檢查資源有效性

virtual BOOL IsValid() const;

傳回值

如果資源有效,則為 TRUE;否則為 FALSE。

CD2DTextFormat::m_pTextFormat

IDWriteTextFormat 的指標。

IDWriteTextFormat* m_pTextFormat;

CD2DTextFormat::operator IDWriteTextFormat*

傳回 IDWriteTextFormat 介面

operator IDWriteTextFormat*();

傳回值

如果物件尚未初始化,則為 IDWriteTextFormat 介面的指標或 Null。

CD2DTextFormat::ReCreate

重新建立 CD2DTextFormat。

virtual HRESULT ReCreate(CRenderTarget* */);

傳回值

如果方法成功,則會傳回S_OK。 否則,它會傳回 HRESULT 錯誤碼。

另請參閱

類別