ITextDocument2::GetPreferredFont method (tom.h)

Retrieves the preferred font for a particular character repertoire and character position.

Syntax

HRESULT GetPreferredFont(
  [in]  long cp,
  [in]  long CharRep,
  [in]  long Options,
  [in]  long curCharRep,
  [in]  long curFontSize,
  [out] BSTR *pbstr,
  [out] long *pPitchAndFamily,
  [out] long *pNewFontSize
);

Parameters

[in] cp

Type: long

The character position for the preferred font.

[in] CharRep

Type: long

The character repertoire index for the preferred font. It can be one of the following values.

tomAboriginal

tomAnsi

tomArabic

tomArmenian

tomBaltic

tomBengali

tomBIG5

tomBraille

tomCherokee

tomCyrillic

tomDefaultCharRep

tomDevanagari

tomEastEurope

tomEmoji

tomEthiopic

tomGB2312

tomGeorgian

tomGreek

tomGujarati

tomGurmukhi

tomHangul

tomHebrew

tomJamo

tomKannada

tomKayahli

tomKharoshthi

tomKhmer

tomLao

tomLimbu

tomMac

tomMalayalam

tomMongolian

tomMyanmar

tomNewTaiLu

tomOEM

tomOgham

tomOriya

tomPC437

tomRunic

tomShiftJIS

tomSinhala

tomSylotinagr

tomSymbol

tomSyriac

tomTaiLe

tomTamil

tomTelugu

tomThaana

tomThai

tomTibetan

tomTurkish

tomUsymbol

tomVietnamese

tomYi

[in] Options

Type: long

The preferred font options. The low-order word can be a combination of the following values.

tomIgnoreCurrentFont

tomMatchCharRep

tomMatchFontSignature

tomMatchAscii

tomGetHeightOnly

tomMatchMathFont

If the high-order word of Options is tomUseTwips, the font heights are given in twips.

[in] curCharRep

Type: long

The index of the current character repertoire.

[in] curFontSize

Type: long

The current font size.

[out] pbstr

Type: BSTR*

The name of the font.

[out] pPitchAndFamily

Type: long*

The font pitch and family.

[out] pNewFontSize

Type: long*

The new font size.

Return value

Type: HRESULT

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

Requirements

Requirement Value
Minimum supported client Windows 8 [desktop apps only]
Minimum supported server Windows Server 2012 [desktop apps only]
Target Platform Windows
Header tom.h
DLL Msftedit.dll

See also

ITextDocument2