Opened 19 years ago
Last modified 12 years ago
#1449 closed defect
Alignment of TrueType label is not beautiful. — at Initial Version
Reported by: | Owned by: | sdlime | |
---|---|---|---|
Priority: | low | Milestone: | |
Component: | MapServer CGI | Version: | 4.6 |
Severity: | minor | Keywords: | |
Cc: |
Description
In the label display processing, the position has been decided based on the rectangle obtained by GD. there is no problem when the character string is usually displayed. but, When the character string is displayed by one character one point, it is not so good. I wrote the explanation patch. -------------------------------- *** maplabel.c.org 2005-08-31 15:09:05.114273793 +0900 --- maplabel.c 2005-08-31 15:03:29.600871424 +0900 *************** *** 313,318 **** --- 313,323 ---- rect->miny = bbox[5]; rect->maxx = bbox[2]; rect->maxy = bbox[1]; + + // baseline shifting. quick fix. + label->offsety += MS_NINT((((bbox[5] + bbox[1])) + size) / 2); + label->offsetx += MS_NINT((bbox[0] / 2)); // optional. + #else msSetError(MS_TTFERR, "TrueType font support is not available.", "msGetLabelSize()"); return(-1); -------------------------------- I think that this is not so good solution. accuracy is bad. IMHO, we would make align method can chosen by the POSITION parameter of MapFile to make it not influence an existing user. ---------------------------------------------------------- sample images are here. (1) displayed by Mapserver 4.6.1 bitmap font http://oi.nu/msbugzilla/hollywood_ms_bitmap.png (2) displayed by Mapserver 4.6.1 truetype font http://oi.nu/msbugzilla/hollywood_ms_truetype.png (3) displayed by Mapserver 4.6.1 truetype font. patch applied. http://oi.nu/msbugzilla/hollywood_ms_tt_patched.png (4) displayed by ESRI ArcMap8 truetype font. http://oi.nu/msbugzilla/HOLLYWOOD_ArcMap.gif # I'm not good at english. sorry. -- IIDA Tetsushi.(hogeman)
Note:
See TracTickets
for help on using tickets.