public String[] asStringArray(CSSName cssName) { return valueByName(cssName).asStringArray(); }
public String[] asStringArray(CSSName cssName) { return valueByName(cssName).asStringArray(); }
public FontSpecification getFont(CssContext ctx) { if (_font == null) { _font = new FontSpecification(); _font.families = valueByName(CSSName.FONT_FAMILY).asStringArray(); FSDerivedValue fontSize = valueByName(CSSName.FONT_SIZE); if (fontSize instanceof IdentValue) { PropertyValue replacement; IdentValue resolved = resolveAbsoluteFontSize(); if (resolved != null) { replacement = FontSizeHelper.resolveAbsoluteFontSize(resolved, _font.families); } else { replacement = FontSizeHelper.getDefaultRelativeFontSize((IdentValue) fontSize); } _font.size = LengthValue.calcFloatProportionalValue( this, CSSName.FONT_SIZE, replacement.getCssText(), replacement.getFloatValue(), replacement.getPrimitiveType(), 0, ctx); } else { _font.size = getFloatPropertyProportionalTo(CSSName.FONT_SIZE, 0, ctx); } _font.fontWeight = getIdent(CSSName.FONT_WEIGHT); _font.fontStyle = getIdent(CSSName.FONT_STYLE); _font.variant = getIdent(CSSName.FONT_VARIANT); } return _font; }
public FontSpecification getFont(CssContext ctx) { if (_font == null) { _font = new FontSpecification(); _font.families = valueByName(CSSName.FONT_FAMILY).asStringArray(); FSDerivedValue fontSize = valueByName(CSSName.FONT_SIZE); if (fontSize instanceof IdentValue) { PropertyValue replacement; IdentValue resolved = resolveAbsoluteFontSize(); if (resolved != null) { replacement = FontSizeHelper.resolveAbsoluteFontSize(resolved, _font.families); } else { replacement = FontSizeHelper.getDefaultRelativeFontSize((IdentValue) fontSize); } _font.size = LengthValue.calcFloatProportionalValue( this, CSSName.FONT_SIZE, replacement.getCssText(), replacement.getFloatValue(), replacement.getPrimitiveType(), 0, ctx); } else { _font.size = getFloatPropertyProportionalTo(CSSName.FONT_SIZE, 0, ctx); } _font.fontWeight = getIdent(CSSName.FONT_WEIGHT); _font.fontStyle = getIdent(CSSName.FONT_STYLE); _font.variant = getIdent(CSSName.FONT_VARIANT); } return _font; }