Hello;
Let me ask which is the simple way (if any ...) to know the list of fonts used in the current text?
Thank you!
Hello;
Let me ask which is the simple way (if any ...) to know the list of fonts used in the current text?
Thank you!
You can use the function FontListAssign to fill a font combobox:
Possible modes are
wpfla_Clear - Clear the strings
wpfla_Screen - Add screen fonts
wpfla_Favorites - Insert 10 favorites first
wpfla_InserteAtStart - Insert at position 0 instead of append mode
wpfla_Seperator - Insert a separator after favorites
wpfla_No_AT_Fonts - exclude fonts with names starting with '@'
function TWPCustomRtfEdit.FontListAssign(list: TStrings;
Modes: TWPFontListAssignMode): Integer;
If you need to list all fonts, this does it for you:
procedure TWPAttrCache.GetFontFavorites(RTFData: TWPRTFDataCollectionBase;
var FontNames: TStringList; MaxCount: Integer);
Found in the TWPRTFProps, accessible as
WPRichText.RTFData.RTFProps.Attributes.GetFontFavorites
Thank you.
Is it any event in where we can know when a new font is used, so we can update the font list at this time?
No. You can check the count of the font index table: RTFProps.FontMaxAnz from time to time if it grew.
Thank you!