Ticket #2862 (closed defect: invalid)
Bug in drawing curved ‘FOLLOW’ labels when displaying Chinese characters
| Reported by: | nnikolov | Owned by: | sdlime |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | MapServer C Library | Version: | 5.2 |
| Severity: | normal | Keywords: | Chinese labels |
| Cc: | tbonfort, dmorissette, aboudreault |
Description
When msPolylineLabelPath() is called in mapprimitive.c it fails because the sizes of the Chinese characters are not calculated correctly. It fails at:
/* If the difference between subsequent angles is > 80% of 180deg
bail because the line likely overlaps itself. */
if ( k > 2 && abs(theta - labelpath->angles[k-2]) > 0.4 * MS_PI ) {
*status = MS_FAILURE; goto FAILURE;
}
These sizes are obtained from the array offsets[] which is populated by calling msGetLabelSizeEx()
msGetLabelSizeEx() in maplabel.c gets the values to put into offsets[] from the function gdImageStringFTEx().
The code displays characters correctly if we force the values in offsets[] to be a reasonable fixed size.
We are using UTF-8 encoding for the Chinese characters, GD 2.0.33 and Mapserver 5.2
