I try to extract the font family name in a css file. When looking in debug, the font family name is present, also when i modify it by a SetFontFamily, but the GetFontFamiliy does not return anything.
public void CssStyleSheettractFontFamily()
{
var parser = new CssParser();
var source = "<!-- body { font-family: Verdana } div.hidden { display: none } -->";
ICssStyleSheet sheet = parser.ParseStyleSheet(source);
Debug.Print( sheet.Rules.Length.ToString());
foreach (ICssStyleRule rule in sheet.Rules)
{
Debug.Print(rule.CssText);
rule.Style.SetFontFamily("Verdana Bold");
Debug.Print("fontfamily", rule.Style.GetFontFamily());
Debug.Print("fontSize", rule.Style.GetFontSize());
}
}
Any advice?
So basic, i did not really print it. See solution below.