Help Center

CRichEditCtx.GetPreferredFontmethod

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

Windowsmethoddocumented

Syntax

PRIVATE FUNCTION CRichEditCtx.GetPreferredFont (BYVAL cp AS LONG, BYVAL CharRep AS LONG, BYVAL nOptions AS LONG, BYVAL curCharRep AS LONG, BYVAL curFontSize AS LONG, BYREF dwsFontName AS DWSTRING, BYREF PitchAndFamily AS LONG, BYREF NewFontSize AS LONG) AS HRESULT

Parameters

NameDescription
cpThe character position for the preferred font.
CharRepThe 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.
nOptionsThe 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.
curCharRepThe index of the current character repertoire.
curFontSizeThe current font size.
fontNameThe name of the font.
PitchAndFamilyThe font pitch and family.
NewFontSizeThe new font size.

Return value

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

Description

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

Example

PRIVATE FUNCTION GetPreferredFont (BYVAL cp AS LONG, BYVAL CharRep AS LONG, _ BYVAL nOptions AS LONG, BYVAL curCharRep AS LONG, BYVAL curFontSize AS LONG, _ BYVAL fontName AS AFX_BSTR PTR, BYREF PitchAndFamily AS LONG, BYREF NewFontSize AS LONG) AS HRESULT

Reference

  • Defined in AfxNova/CRichEditCtx.inc:4734
  • Documented in Windows/WIndows Controls/RichEdit/CRichEditCtx Class.md
  • Topic: CRichEditCtx Class