FontsHandler
Utilities for fonts and fonts families handling.
构造函数
FontsHandler(RAdapter)
Init.
方法
AddFontFamilyMapping(string, string)
Adds a font mapping from to iff the is not found. When the font is used in rendered html and is not found in existing fonts (installed or added) it will be replaced by .
- fromFamily
- the font family to replace
- toFamily
- the font family to replace with
CreateFont(string, double, RFontStyle) : RFont
create font (try using existing font family to support custom fonts)
GetCachedFont(string, double, RFontStyle) : RFont
Get cached font instance for the given font properties. Improve performance not to create same font multiple times.
返回值: cached font instance
IsFontExists(string) : bool
Check if the given font family exists by name
- family
- the font to check
返回值: true - font exists by given family name, false - otherwise
TryGetFont(string, double, RFontStyle) : RFont
Get cached font if it exists in cache or null if it is not.
字段
_existingFontFamilies : Dictionary<string, RFontFamily>
collection of all installed and added font families to check if font exists
_fontsCache : Dictionary<string, Dictionary<double, Dictionary<RFontStyle, RFont>>>
cache of all the font used not to create same font again and again
_fontsMapping : Dictionary<string, string>
Allow to map not installed fonts to different