CssFontFamilyProperty
Information:
https://developer.mozilla.org/en-US/docs/Web/CSS/font-family
Gets an enumeration over all font names.
using AngleSharp.Css;
using AngleSharp.Extensions;
namespace AngleSharp.Dom.Css
{
internal sealed class CssFontFamilyProperty : CssProperty
{
private enum SystemFonts
{
Serif,
SansSerif,
Monospace,
Cursive,
Fantasy
}
internal static readonly IValueConverter<string[]> Converter = Map.DefaultFontFamilies.ToConverter().Or(Converters.StringConverter).Or(Converters.IdentifierConverter.Many(1, 65535).To((string[] names) => string.Join(" ", names)))
.FromList();
internal CssFontFamilyProperty(CssStyleDeclaration rule)
: base(PropertyNames.FontFamily, rule, PropertyFlags.Inherited)
{
}
protected override object GetDefault(IElement element)
{
return "Times New Roman";
}
protected override object Compute(IElement element)
{
string[] array = Converter.Convert(base.Value);
return array[0];
}
protected override bool IsValid(CssValue value)
{
return Converter.Validate(value);
}
}
}