String reqWeight = evalToString(curr.getFontWeight(), feature, null);
@SuppressWarnings("deprecation") @Test public void font() throws Exception { List<Expression> family = new ArrayList<Expression>(); family.add(ff.literal("ariel")); family.add(ff.literal("Helvetica")); family.add(ff.literal("sanserif")); Expression style = ff.literal("noraml"); Expression weight = ff.literal("normal"); Expression size = ff.literal(12); Font font = sf.font(family, style, weight, size); assertEquals(family, font.getFamily()); assertEquals(style, font.getStyle()); // oblique or italic assertEquals(weight, font.getWeight()); // bold or normal assertEquals(size, font.getSize()); assertSame(font.getFontStyle(), font.getStyle()); assertSame(font.getFontFamily(), family.get(0)); assertSame(font.getFontWeight(), font.getWeight()); assertSame(font.getFontSize(), font.getSize()); FontImpl cast = FontImpl.cast(font); assertSame(cast, font); }
private java.awt.Font styleFont(Object feature, Font curr, java.awt.Font javaFont) { String reqStyle = evalToString(curr.getFontStyle(), feature, null); int styleCode; if (fontStyleLookup.containsKey(reqStyle)) { styleCode = ((Integer) fontStyleLookup.get(reqStyle)).intValue(); } else { styleCode = java.awt.Font.PLAIN; } String reqWeight = evalToString(curr.getFontWeight(), feature, null); if ("Bold".equalsIgnoreCase(reqWeight)) { styleCode = styleCode | java.awt.Font.BOLD; } float size = evalToFloat(curr.getSize(), feature, 10); return javaFont.deriveFont(styleCode, size); }
String reqWeight = (String) fonts[k].getFontWeight().evaluate(feature); String reqWeight = (String) fonts[k].getFontWeight().evaluate(feature);
public void setEdited(Font font){ this.font = font; if(font != null){ guiFamily.setExpression(font.getFontFamily()); guiSize.setExpression(font.getFontSize()); guiStyle.setExpression(font.getFontStyle()); guiWeight.setExpression(font.getFontWeight()); } }
/** Null safe copy of a single font */ protected Font copy(Font font) { if( font == null) return font; Expression fontFamily = copy( font.getFontFamily() ); Expression fontStyle = copy( font.getFontStyle() ); Expression fontWeight = copy( font.getFontWeight() ); Expression fontSize = copy( font.getFontSize() ); Font copy = sf.createFont(fontFamily, fontStyle, fontWeight, fontSize); return copy; }
if (font.getFontWeight() != null) { font.getFontWeight().accept(this, null);
if (font.getFontWeight() != null) { font.getFontWeight().accept(this,null);
if (font.getFontWeight() != null) { font.getFontWeight().accept(this,null);
encodeCssParam("font-weight", fonts[0].getFontWeight()); end("Font");
if (font.getFontWeight() != null) { font.getFontWeight().accept(this,null);
encodeCssParam("font-weight", fonts[0].getFontWeight()); end("Font");