The standard behaviour when rendering WMS layers is to keep the text size across all scales and then filter out colliding labels so that the text remains readable, although delivering incomplete information.
Now, I'd like to invite the user to zoom in when he wants to actually read the labels while keeping the overall view on all data (i.e. very small, unreadable text labels) when zooming out.
I know that the simplest way to render scale-based elements is to use the and elements on rules, but that will end up in tens of rules, which I'd like to avoid.
The idea is then to use a function to define the text size, something like:
<TextSymbolizer>
<Label>
<ogc:PropertyName>name</ogc:PropertyName>
</Label>
<Font>
<CssParameter name="font-family">Arial</CssParameter>
<CssParameter name="font-size">
<function name="get_number_between_1_and_14_depending_on_scale" />
</CssParameter>
<CssParameter name="font-style">normal</CssParameter>
<CssParameter name="font-weight">bold</CssParameter>
</Font>
</TextSymbolizer>