/** * Creates a default text symbolizer. Warning: there is no definition of a default text * symbolizer in the SLD standard, this is provided just for convenience and uniformity with the * other symbolizers * * @return the default text symbolizer */ public TextSymbolizer createTextSymbolizer() { TextSymbolizer ts = sf.createTextSymbolizer(); ts.setFill(createFill(Color.BLACK)); ts.setLabel(literalExpression("Label")); ts.fonts().add(createFont("Lucida Sans", 10)); return ts; }
public TextSymbolizer createTextSymbolizer( Fill fill, Font[] fonts, Halo halo, Expression label, LabelPlacement labelPlacement, String geometryPropertyName) { TextSymbolizer tSymb = new TextSymbolizerImpl(filterFactory); tSymb.setFill(fill); if (fonts != null) { tSymb.fonts().addAll(Arrays.asList(fonts)); } tSymb.setGeometryPropertyName(geometryPropertyName); tSymb.setHalo(halo); tSymb.setLabel(label); tSymb.setLabelPlacement(labelPlacement); return tSymb; }
symbol.fonts().addAll(fonts);
for (Font font : fonts) { if (font != null) { ts.fonts().add(font);
public void visit(TextSymbolizer text) { TextSymbolizer copy = sf.createTextSymbolizer(); copy.setFill(copy(text.getFill())); copy.fonts().clear(); copy.fonts().addAll(copyFonts(text.fonts())); copy.setGeometry(copy(text.getGeometry())); copy.setUnitOfMeasure(text.getUnitOfMeasure()); copy.setHalo(copy(text.getHalo())); copy.setLabel(copy(text.getLabel())); copy.setLabelPlacement(copy(text.getLabelPlacement())); copy.setPriority(copy(text.getPriority())); copy.getOptions().putAll(text.getOptions()); if (text instanceof TextSymbolizer2) { TextSymbolizer2 text2 = (TextSymbolizer2) text; TextSymbolizer2 copy2 = (TextSymbolizer2) copy; copy2.setGraphic(copy(text2.getGraphic())); copy2.setSnippet(copy(text2.getSnippet())); copy2.setFeatureDescription(copy(text2.getFeatureDescription())); copy2.setOtherText(copy(text2.getOtherText())); } if (STRICT && !copy.equals(text)) { throw new IllegalStateException( "Was unable to duplicate provided TextSymbolizer:" + text); } pages.push(copy); }
symbol.setHalo((Halo) value[i].getValue()); symbol.fonts().addAll(fonts);
List<Font> fonts = symbolizer.fonts(); java.awt.Font[] javaFonts = getFonts(feature, fonts, symbolizer); ts2d.setFonts(javaFonts);
ts.fonts().add((Font) node.getChildValue("Font"));
for (Font font : copy.fonts()) { if (font != null) { font.setSize(rescale(font.getSize()));
for (Font font : copy.fonts()) { font.setSize(rescale(font.getSize(), uom));
boolean refreshUI = false; if ((rule != null) && (sldWriter != null)) { List<Font> fontList = symbolizer.fonts(); Font localFont = fontList.get(0); if (isFontNameUpdated()) { if (currentSymbolizer instanceof TextSymbolizer) { TextSymbolizer textSymbolizer = (TextSymbolizer) currentSymbolizer; textSymbolizer.fonts().clear(); textSymbolizer.fonts().add(localFont); refreshUI = true;