共用方式為


IDWriteGdiInterop1::CreateFontFromLOGFONT 方法 (dwrite_3.h)

建立符合 LOGFONT 結構所指定屬性的字型物件。

語法

HRESULT CreateFontFromLOGFONT(
  [in]           LOGFONTW const        *logFont,
  [in, optional] IDWriteFontCollection *fontCollection,
  [out]          IDWriteFont           **font
);

參數

[in] logFont

類型: LOGFONTW

包含 GDI 相容字型描述的結構。

[in, optional] fontCollection

類型: IDWriteFontCollection*

要搜尋的字型集合。 如果為 Null,則會使用本機系統字型集合。

[out] font

類型: IDWriteFont**

如果成功,則會收到新建立的字型物件,如果發生錯誤,則為 Null。

傳回值

類型: HRESULT

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

需求

   
目標平台 Windows
標頭 dwrite_3.h
程式庫 Dwrite.lib
Dll Dwrite.dll

另請參閱

IDWriteGdiInterop1