Skip to content

Text Symbolizer Multi font support

Jody Garnett edited this page Aug 7, 2015 · 18 revisions

Description

Restore the multi-font support that was removed in the switch to SE 1.1:

  • SLD 1.0 is still supported, and so we should avoid throwing away the extra fonts that can be declared as fallbacks like the current TextSymbolizerImpl does (in order to align with that deprecation)
  • SLD 1.0 is for once more expressive than SE 1.1, so deprecating those methods is a functional regression.

This is part of work Andrea is doing to support multi-script labels.

Here is the change to FontSymbolizer:

public interface TextSymbolizer extends org.opengis.style.TextSymbolizer,Symbolizer {
    /**
     * Device independent Fonts used to render the label. Fonts are used in order
     * of priority given.
     */
   List<Font> fonts();

    // Font[] getFonts(); // removed
    
    /**
     * Initial Font recommended for rendering this symbolizer.
     */
    Font getFont();

    /**
     * Initial Font recommended for rendering this symbolizer.
     * @param font
     */
    public void setFont( org.opengis.style.Font font );

    //addFont( org.opengis.style.Font font ); // removed (unused in GeoTools)
}

The existing FontSymbolizer.getFonts() method can be removed.

References:

Status

Choose one of:

  • Under Discussion
  • In Progress
  • Completed
  • Rejected,
  • Deferred

Voting:

  • Andrea Aime +1
  • Ben Caradoc-Davies +1
  • Christian Mueller +1
  • Ian Turton +1
  • Justin Deoliveira
  • Jody Garnett +1
  • Simone Giannecchini +1

Tasks

  1. ✅ Update implementation of FontSymbolizerImpl to use a List internally
    • Fixed DuplicatingStyleVisitor to copy fonts
    • Fixed StyleBuilder to avoid creating List with a single null font by default
  2. ✅ Remove references to deprecated methods
    • Remove internal references to FontSymblizer.getFonts() method
    • Remove internal references to FontSymblizer.addFont( Font ) method
    • etc..
  3. ✅ Documentation changes
  4. Remove deprecated methods - Can wait until after 14.0 release.

This proposal is just to restore the data structure, hooking multi-font support into the renderer is a bug fix Andrea is working on.

API Change

Described above.

Clone this wiki locally