FontsHandler

TheArtOfDev.HtmlRenderer.Core.Handlers

Utilities for fonts and fonts families handling.

コンストラクター

メソッド

AddFontFamily(RFontFamily)

Adds a font family to be used.

fontFamily
The font family to add.
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