MapServer / MapServer-import

3 stars 2 forks source link

using FDB fonts and output=SINGLE #733

Open tbonfort opened 12 years ago

tbonfort commented 12 years ago

Reporter: assefa Date: 2004/06/16 - 20:03

Reported by Steve Spicklemire <steve@spvi.com>

Assefa's response to the e-mail

I have checked the code to see what would be the problem. Here is the 
situation :
  - when rederning in OUPUT_MOVIE = 'SINGLE' mode, all the drawing pass 
through the GD functions : basically every thing is drawn in a temporary GD 
image as if you had specified a GD format (like PNG, GIF ...).  At the end 
this GD image is converted and inserted inside the movie.

  - when rendering in mode MULTIPLE, you get vector output and all the code is 
handled through the swf driver.

 As for the fonts, the problem you probably have is that your classes refer to 
an FDB font that is handled properly in the vector (MULTIPLE)  case but can 
not work in the raster case (SINGLE), since GD which is used to draw the text 
does not understand the FDB font. 

 Quick solution to your problem: if you use your mapfile in SINGLE mode, use 
true type fonts in your classes. If you want vector output using the MULTIPLE 
mode, use the FDB fonts.

 The real solution would be for ming (which is the libabry used to generate 
the swf files), to support True Type fonts. 

 I am also checking to see if there can be a small hack that can be introduced 
inside the mapserver swf code to correct this problem.

====
original bug reprting e-mail

Steve Spicklemire wrote:

> Hi Folks,
> 
> I'm trying to track down a apparent bug in rendering labels in SWF 
> output when OUPUT_MOVIE is 'SINGLE'.
> 
> The code is a bit confusing to me (no doubt primarily due to the fact 
> that I don't understand why it's doing things the way it is!). It 
> appears that this bit of code in mapswf.c/msDrawLabelCacheSWF is not 
> working:
> 
> /* -------------------------------------------------------------------- */
> /*      if the output is single (SWF file based on one raster that      */
> /*      will contain all  the rendering), draw the lables using the     */
> /*      GD driver.                                                      */
> /* -------------------------------------------------------------------- */
>     if(strcasecmp(msGetOutputFormatOption(image->format,
>                                           "OUTPUT_MOVIE",""),
>                   "SINGLE") == 0)
>     {
>         imagetmp = (imageObj *)image->img.swf->imagetmp;
>         msImageInitGD( imagetmp, &map->imagecolor);
>         msDrawLabelCacheGD(imagetmp->img.gd, map);
>         oShape = gdImage2Shape(imagetmp->img.gd);
>         //nTmp = image->img.swf->nCurrentMovie;
>         SWFMovie_add(GetCurrentMovie(map, image), oShape);
>         return 0;
>     }
> 
> I don't know enough about the GD methods to tell for sure what's going 
> on. When in MULTIPLE mode I get nice vector fonts drawn on each layer 
> with labels. WHen in SINGLE I see no text anywhere. ;-(
> 
> I've had reasonable success sorting out bugs in mapswf.c before.. but 
> this one has me (momentarily) stumped!
> 
> Any thoughts about how to track this one down would be appreciated.
> 
> 
> BTW... I'm pretty sure this actually *worked* at some point... wierd.
> 
> thanks!
> -steve
>
tbonfort commented 12 years ago

Author: assefa Date: 2004/11/05 - 23:20

set target to FUTURE.
tbonfort commented 12 years ago

Author: laurent Date: 2009/03/13 - 12:43 Hi this can be solved by switching to Ming 0.4+ as it supports ttf fonts cf Ticket #2858 Laurent BAEY