= !MapGuide RFC 186 - Support label justification for basic stylization = This page contains a change request (RFC) for the !MapGuide Open Source project. More !MapGuide RFCs can be found on the [wiki:MapGuideRfcs RFCs] page. == Status == ||RFC Template Version||(1.0)|| ||Submission Date||5 Feb 2023|| ||Last Modified||5 Feb 2023|| ||Author||Jackie Ng|| ||RFC Status||draft|| ||Implementation Status||pending|| ||Proposed Milestone||4.0|| ||Assigned PSC guide(s)||(when determined)|| ||'''Voting History'''||(vote date)|| ||+1|||| ||+0|||| ||-0|||| ||-1|||| ||no vote|| || == Overview == This RFC proposes to add support for feature label justification in basic stylization mode == Motivation == This 14 year old bug (https://trac.osgeo.org/mapguide/ticket/772) is the result of the rendering/stylization engine having a hard-coded "Left" justification for feature labels in basic stylization. The reason for this is because the Layer Definition XML schema does not define a justification setting for the `TextSymbol` element (which controls feature label settings). The rendering/stylization engine itself allows for this justification to be changed (so there is no work required on this front), but there is nothing on the Layer Definition XML to change this justification value from its "Left" default. == Proposed Solution == Update our v4.0.0 LayerDefinition XML schema to introduce a new optional `LabelJustification` element as a child element of the `TextSymbol` element type. {{{ A string FDO expression for the label justification. Must evaluate to one of the 'Left', 'Right', 'Center' or 'Justify' (which is the same as 'Left'). }}} This element accepts any of the following values, which will result in the following effect (using Sheboygan Voting Districts with multi-line label as an example) === `Left` or `Justify` === [[Image(LabelJustifyLeft_PNG.png)]] === `Right` === [[Image(LabelJustifyRight_PNG.png)]] === `Center` === [[Image(LabelJustifyCenter_PNG.png)]] As the v4.0.0 Layer Definition schema has not yet been finalized as MapGuide Open Source 4.0 is still in development, we'll take this opportunity to fix up an oversight in [wiki:MapGuideRfc178]. The new `IncludeFeatureBounds` element introduced with this RFC was made a required element by mistake. For this RFC, we'll fix this element to be optional. This feature change has been implemented in the `basic_label_justification` sandbox branch. Upon adoption of this RFC, it will be merged into trunk. == Implications == This new `LabelJustification` setting is primarily for dealing with multi-line labels. It has no effect for feature labels that do not span multiple lines. == Test Plan == Add new rendering service tests to exercise the new justification setting == Funding / Resources == Community