[Label Placement] Baseline is displaced when the label has line breaks and descenders

Description

Hi there,

I’m facing an issue related with the “_Label Placement_”.
When a label has line breaks and letter with descenders, such as “_g_”, “_p_”, “_q_”, “_y_”, “_j_”, the baseline gets displaced.

For example:

  • CASE 1 – The label has line breaks but no descenders >>> IT WORKS FINE (see attached-file case_1_sample_1.png)

  • CASE 2 – The label has descenders but no line breaks >>>_ IT WORKS FINE_ (see attached-file case_2_sample_1.png)

  • CASE 3 – The label has line breaks and descenders >>> *+

    Problem: THE BASELINE IS DISPLACED

    +* (see attached-files case_3_sample_1.png & case_3_sample_2.png)

I also have attached to this ticket the SLD file and some sample data to reproduce the problem.

Best regards,

Fabian

Environment

GeoServer Version 2.13.2

Attachments

17

Activity

Fabian Ortega 
April 26, 2019 at 11:05 AM

Yes, of course. In the attached files to this message I'm sending you snapshots using the following fonts :

  • Arial

  • Calibri

  • Consolas

  • Courier New

  • Georgia

  • Tahoma

  • Times New Roman

  • Verdana

If you need anything else, please don't hesitate

Imran Rajjad 
April 26, 2019 at 10:37 AM

can you please send snapshots when using different fonts also.

Fabian Ortega 
April 25, 2019 at 12:43 PM

yes, the displacement has been removed already. The attached files "rendered_with_version_2.13.2.png" and "rendered_with_version_2.14.3.png" don't have any displacement applied.

Imran Rajjad 
April 25, 2019 at 12:30 PM

yes the changes were fixed, can you please try to remove the displacement as see if things change?

Fabian Ortega 
April 25, 2019 at 12:20 PM

Hi Andrea and Imran,

I'm sorry for my late reply, I was on vacations for a long period, but now I'm back.

First of all, thank you for your help.

Second, regarding the first question, I'm using Windows 7 Professional x64 and my Java Provider is Oracle.

Indeed, case 1 and case 2 should place the text below the line, I added the displacement of -22 in the y direction 'cuz I thought this was normal and it needed to be "fixed" it by adding a constant displacement in the y direction.

So, I've downloaded GeoServer version 2.14.3, tested it and the results are exactly the same than version 2.13.2. Are you sure that you're getting different results? If yes, what version of GeoServer are you using?

See the attached files rendered_with_version_2.13.2.png and rendered_with_version_2.14.3.png please.

Details

Assignee

Reporter

Triage

Priority

Created October 11, 2018 at 9:20 AM
Updated April 26, 2019 at 11:05 AM