Cartographic CSS Plugin ----------------------- The ``gt-css`` module is a plugin used used to generate Style objects from a human readable CSS representation. To use this module in your application: Related Links: * `CSS `_ (GeoServer User Guide) * `CSS Cookbook `_ (GeoServer User Guide) ``Maven``:: org.geotools gt-css ${geotools.version} Cartographic CSS parser ''''''''''''''''''''''' Here is an example Cartographic CSS style definition from the CSS Cookbook: .. code-block:: css * { mark: symbol(circle); mark-size: 6px; } :mark { fill: red; } The following code can be used to parse the above file and generate a GeoTools Style object: .. code-block:: java Stylesheet ss = CssParser.parse(css); CssTranslator translator = new CssTranslator(); Style style = translator.translate(ss); Here is the SLD representation of the generated style: .. code-block:: xml Default Styler circle #ff0000 6 first Rule metadata i18n '''''''''''''''''' GeoTools CSS supports internationalized rule metadata in rule comments for ``@title`` and ``@abstract``. Localized variants are provided with a language suffix: .. code-block:: css /* * @title Default title * @title[en] English title * @title[it] Titolo italiano * @abstract Default abstract * @abstract[en_US] English abstract */ * { stroke: #444; } When translated to SLD, localized values are emitted as ```` entries under ```` and ``<Abstract>``. In cascaded styles where multiple CSS rules combine into one SLD rule: * default ``@title`` values are concatenated using ``", "`` * default ``@abstract`` values are concatenated using newlines * localized values are concatenated per language independently Language tags accept both ``-`` and ``_`` separators (for example ``en-US`` and ``en_US``). Malformed localized tags that match the localized syntax but are not valid language tags cause translation to fail. Note: * i18n support is currently for rule metadata comments only (``@title[...]``, ``@abstract[...]``) * style directives such as ``@styleTitle`` and ``@styleAbstract`` are not localized in GeoTools CSS