[mapserver-users] SVG text

Stephen Woodbridge woodbri at swoodbridge.com
Tue Dec 31 06:58:31 PST 2013


On 12/31/2013 9:22 AM, Jefferson Williams wrote:
> When you say "a specific rendering driver"...  I am not a professional
> programmer and am not trying to speak above my level, but it seems to me
> that producing a text element in an SVG file is a fairly trivial task
> compared to rendering the text into vectors, which is what Cairo does
> now. The text doesn't need to be "rendered" at all, but simply inserted
> into a text element such as this example from w3.org <http://w3.org>:
>
> <text x="250" y="150" font-family="Verdana" font-size="55" fill="blue"
>  >Hello, out there</text>
>
> Thoughts? I realize that this is a Cairo issue, not a Mapserver issue,
> since the SVG rendering was moved out of Mapserver; but would you agree
> that this would be a fairly simple task from a programming perspective?

The concept is simple as you state, but you are missing the expectation 
that the SVG text looks simpler if not the same as the text rendered by 
other drivers. So while you only have to dump the text there is still a 
lot of work to compute the size, position, scaling, orientation, etc for 
that piece of text and then you have to also deal with text rendered 
along a line which is rendered as glyphs not strings, not to mention how 
you want to deal with rendering texts like Arabic and other script like 
texts.

So yes, straight forward until you start trying to make things like 
similar. If you got an SVG where you only needed to change one text 
string but instead had to fiddle with all of them because of the above 
issues, that I think would not be a good solution.

My guess today if you take an SVG file into something like inkscape, it 
is a fairly easy process to window the text vectors and replace them 
with a new text element, even if it is annoying.

That said, I'm not saying that this is a bad idea as I can see it might 
be very useful. I'm only trying to set an appropriate expectation to the 
size of the effort. I'll leave the details to Thomas.

-Steve W

> On Tue, Dec 31, 2013 at 7:14 AM, thomas bonfort
> <thomas.bonfort at gmail.com <mailto:thomas.bonfort at gmail.com>> wrote:
>
>     Jefferson,
>     There is currently no way to produce those elements with mapserver,
>     and to my knowledge there are no plans to do so yet. A specific
>     rendering driver would need to be implemented to achieve this, but has
>     not yet been funded or proposed.
>
>     regards,
>     thomas
>
>     On 24 December 2013 17:42, Jefferson Williams
>     <jefferson.d.williams at gmail.com
>     <mailto:jefferson.d.williams at gmail.com>> wrote:
>      > I'm a long-time user of PHP Mapscript and have written code to
>     produce maps
>      > for Wikipedia.  Older versions of Mapscript produced SVG files that
>      > contained text elements.  In more recent versions, text is
>     produced as a
>      > series of vectors instead, which means that the text cannot be
>     edited.
>      > Often auto-generated maps need to be tweaked in various ways
>     before they are
>      > ready for the public. Now I can move text, but I cannot edit it.
>      >
>      > Is there a way with 6.2 or 6.4 that labels can be produced as
>     text elements
>      > in the resulting SVG file?
>      >
>      > --
>      >
>      > Jeff Williams
>      >
>      > _______________________________________________
>      > mapserver-users mailing list
>      > mapserver-users at lists.osgeo.org
>     <mailto:mapserver-users at lists.osgeo.org>
>      > http://lists.osgeo.org/mailman/listinfo/mapserver-users
>
>
>
>
> --
>
> Jeff Williams
>
>
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>



More information about the mapserver-users mailing list