Opened 13 years ago
Last modified 12 years ago
#4013 assigned defect
Font rendering with transparency in PNGs using PC256
Reported by: | posthumusb | Owned by: | sdlime |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | Renderer API | Version: | 6.0 |
Severity: | normal | Keywords: | |
Cc: | dmorissette, sdlime |
Description
Version: MapServer 6.0.1 (from MS4W 3.0.1) OS: Windows XP Pro SP3
In MapServer 6.0, output PNGs using IMAGEMODE PC256 and TRANSPARENT ON in the output format results in corrupted text when rendering truetype fonts. This worked fine in MS 5.4 and 5.6.
Here is the output format causing this issue:
OUTPUTFORMAT NAME png256 DRIVER "GD/PNG" MIMETYPE "image/png" IMAGEMODE PC256 EXTENSION "png" TRANSPARENT ON END
Attached is a stand-alone mapfile with a truetype font and font-list file. Resulting PNGs using MS 5.4 and MS 6.0 are also included for comparison.
This issue was first raised in this post: http://osgeo-org.1803224.n2.nabble.com/Font-rendering-in-MapServer-6-0-tt6555935.html
Though using the AGG renderer is an option, it creates new challenges when working with Internet Explorer 6 (see http://osgeo-org.1803224.n2.nabble.com/Rendering-with-a-single-transparent-colours-in-MapServer-6-tt6769109.html). Having a fully functional PC256 option would alleviate this problem.
Attachments (2)
Change History (8)
by , 13 years ago
Attachment: | fontRenderingBug.zip added |
---|
comment:1 by , 13 years ago
Cc: | added |
---|---|
Component: | WMS Server → Renderer API |
Owner: | changed from | to
Rendering issue. Reassigned to tbonfort.
comment:2 by , 13 years ago
comment:4 by , 13 years ago
In mapgd.c, there's a condition that converts the background colour to purple (117,17,91) if either the background colour does not exist, is not valid, OR transparency is turned on. This purple colour is bleeding into the text around the edges, causing the jagged appearance of the text.
I've attached is a potential patch that sets the background to (117,17,91) only if the background colour does not exist or is invalid, and then worries about transparency later. This fixes the issue, though I can't say if it breaks something that maybe was relying on the purple background (hopefully not).
comment:5 by , 12 years ago
Steve or Thomas, can either of you have a spare moment, can you take a look at the patch submitted? It's a small fix that has been working well for me over the last month or so, but maybe it doesn't work for all scenarios that one of you would know of.
comment:6 by , 12 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
Mapfile showing font rendering bug using PC256 with transparency