Text Symbolizer Multi font support - STEMLab/geotools GitHub Wiki
- Contact: jodygarnett
- Tracker: GEOT-5183
- Pull Request: https://github.com/geotools/geotools/pull/928
- TLDR: Restore data structure for SLD 1.0 multi font support
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:
- Un-deprecating multi-font support in TextSymbolizer (geotools-devel discussion)
- GEOT-5183 pull request: https://github.com/geotools/geotools/pull/926 (jody)
- GEOT-5185 pull request: https://github.com/geotools/geotools/pull/927 (andrea)
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
- ✅ 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
- ✅ Remove references to deprecated methods
- Remove internal references to FontSymblizer.getFonts() method
- Remove internal references to FontSymblizer.addFont( Font ) method
- etc..
- ✅ Documentation changes
- API change make a note upgrading page.
- 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.
Described above.