Extracts all unique font names used in an MText string.
This function searches for font commands in the format \f{fontname}| or \f{fontname}; and returns a set of unique font names.
Font names are converted to lowercase to ensure case-insensitive uniqueness.
Parameters
mtext: string
The MText string to analyze for font names
removeExtension: boolean = false
Whether to remove font file extensions (e.g., .ttf, .shx) from font names. Defaults to false.
Returns Set<string>
A Set containing all unique font names found in the MText string, converted to lowercase
Example
constmtext = "\\fArial.ttf|Hello\\fTimes New Roman.otf|World"; constfonts = getFonts(mtext, true); // Returns: Set(2) { "arial", "times new roman" }
Extracts all unique font names used in an MText string. This function searches for font commands in the format \f{fontname}| or \f{fontname}; and returns a set of unique font names. Font names are converted to lowercase to ensure case-insensitive uniqueness.