CRichEditCtx.GetPreferredFontmethod
Retrieves the preferred font for a particular character repertoire and character position.
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
| Name | Description | |
|---|---|---|
cp | The character position for the preferred font. | |
CharRep | 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. | |
nOptions | 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. | |
curCharRep | The index of the current character repertoire. | |
curFontSize | The current font size. | |
fontName | The name of the font. | |
PitchAndFamily | The font pitch and family. | |
NewFontSize | The 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