Package org.geotools.styling

Examples of org.geotools.styling.Font$Style


  protected Font parseFont(Node root) {
    if (LOGGER.isLoggable(Level.FINEST)) {
      LOGGER.finest("parsing font");
    }

    Font font = factory.getDefaultFont();
    NodeList list = findElements(((Element) root), "CssParameter");
    int length = list.getLength();
    for (int i = 0; i < length; i++) {
      Node child = list.item(i);

      if ((child == null) || (child.getNodeType() != Node.ELEMENT_NODE)) {
        continue;
      }

      Element param = (Element) child;
      org.w3c.dom.NamedNodeMap map = param.getAttributes();
      final int mapLength = map.getLength();
      for (int k = 0; k < mapLength; k++) {
        String res = map.item(k).getNodeValue();

        if (res.equalsIgnoreCase("font-family")) {
          font.setFontFamily(parseCssParameter(child));
        } else if (res.equalsIgnoreCase("font-style")) {
          font.setFontStyle(parseCssParameter(child));
        } else if (res.equalsIgnoreCase("font-size")) {
          font.setFontSize(parseCssParameter(child));
        } else if (res.equalsIgnoreCase("font-weight")) {
          font.setFontWeight(parseCssParameter(child));
        }
      }
    }

    return font;
View Full Code Here


        }

        protected void setLabelStyle(Style style, SimpleFeature feature, TextSymbolizer symbolizer) {
            LabelStyle ls = style.createAndSetLabelStyle();
            double scale = 1;
            Font font = symbolizer.getFont();
            if(font != null && font.getSize() != null) {
                // we make the scale proportional to the normal font size
                double size = font.getSize().evaluate(feature, Double.class);
                scale = Math.round(size / Font.DEFAULT_FONTSIZE * 100) / 100.0;
            }
            ls.setScale(scale);

            Fill fill = symbolizer.getFill();
View Full Code Here

TOP

Related Classes of org.geotools.styling.Font$Style

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.