Opened 15 years ago

Closed 15 months ago

#772 closed defect (fixed)

Multiline text displays within a region as left justification only

Reported by: zspitzer Owned by: jng
Priority: medium Milestone: 4.0
Component: Rendering Service Version: 2.4.0
Severity: minor Keywords:
Cc: waltweltonlair External ID:

Description

Is there any way to set it to default to Centre Justification, this would seem more logical in a region area. In the XML it does seem to be set as ‘CENTRE’.

Attachments (2)

sample_layer.xml (1.6 KB ) - added by zspitzer 15 years ago.
mapguide label justification problem.png (132.0 KB ) - added by zspitzer 15 years ago.

Download all attachments as: .zip

Change History (13)

by zspitzer, 15 years ago

Attachment: sample_layer.xml added

comment:1 by tomfukushima, 15 years ago

Cc: waltweltonlair added

Walt, do you know what might be going on here and who to ask about it?

comment:2 by jbirch, 14 years ago

Any update on this guys? Still applicable to 2.1?

comment:3 by waltweltonlair, 14 years ago

For multi-line text there are two types of horizontal alignment. To see this draw a rectangle that fully encompasses the text vertically, and has width equal to the widest line.

  • The horizontal and vertical alignment label settings control how the overall rectangle is positioned relative to the computed label position. For example, if the horizontal alignment is left and the vertical alignment is top, then the top-left corner of the rectangle will be positioned at the computed label position.
  • Within the rectangle there's the text justification which controls how the different lines of text align relative to each other. Left justification - all text is against the left edge of the rectangle, right justification - the end of each line of text is against the right edge of the rectangle, etc.

The default horizontal and vertical alignments are set to Center and Halfline, but the justification is set to left. What you're asking for is center justification.

For the legacy stylization there's unfortunately no schema setting for justification, so you can't modify your layer to get the effect you want. Note that the enhanced stylization schema does have it.

The good news is that the stylization code already supports the different justifications. It's just a matter of changing the label generation code to specify center justification.

comment:4 by waltweltonlair, 14 years ago

Are we safe making this change in the code? It would affect all multi-line labels for polygon features.

comment:6 by jng, 12 years ago

Milestone: 2.4

comment:7 by jng, 12 years ago

Milestone: 2.42.5

comment:8 by jng, 11 years ago

Milestone: 2.52.6

comment:9 by jng, 6 years ago

Milestone: 3.03.3

Ticket retargeted after milestone closed

comment:10 by jng, 5 years ago

Milestone: 3.34.0

Milestone renamed

comment:11 by jng, 15 months ago

Owner: set to jng
Resolution: fixed
Status: newclosed

In 10026:

Implement MapGuide RFC 186

Fixes #772

Merged revision(s) 10023-10025 from sandbox/jng/basic_label_justification:

#772: Fix up element documentation
#772: Add basic stylization support for justification of labels. This support already existed in the rendering/stylization engine. The justification setting simply never surfaced to any supported element in the current Layer Definition XML schema, so it always defaulted to left justification. This setting will be most impactful when dealing with multi-line feature labels where such a setting becomes important.

New rendering service tests have been added to exercise the various label justification settings. Manually inspecting the rendered results verifies the new justification setting is being respected.

Since we're here, we are also cleaning up the current v4.0.0 schema by making the previously introduced IncludeBoundsForSelectedFeatures element optional.

Note: See TracTickets for help on using tickets.