Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TextSymbolizer vertical_align should have varying default #485

Closed
artemp opened this issue Oct 11, 2011 · 1 comment
Closed

TextSymbolizer vertical_align should have varying default #485

artemp opened this issue Oct 11, 2011 · 1 comment
Milestone

Comments

@artemp
Copy link
Member

artemp commented Oct 11, 2011

Consider a common case:

  • A symbol with a text label.
  • You use dy to move the text label to appear just under the symbol.
  • The default is vertical_alignment="middle".
  • The label is being dropped the moment you have multiline labels.

A single line label with default valign shows:

<TextSymbolizer ... size="12" dy="16"/>

[[Image(valign-middle_1line_dy16.png)]]

A two line label with default valign is being dropped, because the upper line now intersects the symbol:

<TextSymbolizer ... size="12" dy="16"/>

[[Image(valign-middle_2line_dy16.png)]]

A two line label with bottom valign:

<TextSymbolizer ... size="12" dy="16" vertical_alignment="bottom"/>

[[Image(valign-bottom_2line_dy16.png)]]

This is now a bit too far away from the symbol, so we can put it closer:

<TextSymbolizer ... size="12" dy="10" vertical_alignment="bottom"/>

[[Image(valign-bottom_2line_dy10.png)]]

Single line labels are still as close to the symbol as well:

[[Image(valign-bottom_1line_dy10.png)]]

In fact, with bottom alignment, it doesn't matter how many lines you have, as they will always start just under the symbol.

The same logic works in reverse when placing the label above the symbol.

The default vertical_alignment for TextSymbolizer should depend on the value of dy:

|| dy = 0 || vertical_alignment="middle" ||
|| dy > 0 || vertical_alignment="bottom" ||
|| dy < 0 || vertical_alignment="top" ||

@artemp
Copy link
Member Author

artemp commented Oct 11, 2011

[artem] implemented in r1527. Thanks, Ldp!

@artemp artemp closed this as completed Oct 11, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant