public static bool TryGetFontSize(string value, out PDFUnit size) { switch (value.ToLower()) { case ("medium"): size = MediumFontSize; return(true); case ("small"): size = SmallFontSize; return(true); case ("x-small"): size = XSmallFontSize; return(true); case ("xx-small"): size = XXSmallFontSize; return(true); case ("large"): size = LargeFontSize; return(true); case ("x-large"): size = XLargeFontSize; return(true); case ("xx-large"): size = XXLargeFontSize; return(true); case ("larger"): case ("smaller"): size = PDFUnit.Zero; return(false); default: if (CSSStyleValueParser.ParseCSSUnit(value, out size)) { return(true); } else { return(false); } } }
public static bool TryGetLetterSpacing(string value, out PDFUnit size) { switch (value.ToLower()) { case ("normal"): size = NormalSpacing; return(true); default: if (CSSStyleValueParser.ParseCSSUnit(value, out size)) { return(true); } else { return(false); } } }