Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2004:
[Freeciv-Dev] Re: Betr: Re: (PR#7123) Metaissue for FS
Home

[Freeciv-Dev] Re: Betr: Re: (PR#7123) Metaissue for FS

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] Re: Betr: Re: (PR#7123) Metaissue for FS
From: "Raimar Falke" <i-freeciv-lists@xxxxxxxxxxxxx>
Date: Fri, 2 Jan 2004 11:00:37 -0800
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=7123 >

On Fri, Jan 02, 2004 at 05:58:11AM -0800, Raimar Falke wrote:
> > Regarding overlays of text over complex drawn backgrounds: always add an
> > outline around the text. The outline should always be black unless the
> > text is black or very dark, in that case the outline should be white.
> > 
> > The reason should be obvious:
> > http://webreference.com/graphics/column20/art/psout.gif
> 
> Also added to my todo-list.

A difficult topic. The poor-man version (I call this the
halo-method) looks like this:

      for (d = 0; d < 8; d++) {
        struct ct_point p2 = p;

        p2.x += DIR_DX[d];
        p2.y += DIR_DY[d];
        be_draw_bitmap(target, 0, black, &p2, 
                       string->data->glyphs[i].bitmap);
      }
      be_draw_bitmap(target, 0, string->foreground, &p,
                     string->data->glyphs[i].bitmap);

You first draw 8 different versions of the bitmap in black and then
the final one in the real color.

I was under the impression that there must be a more elegant
method. freetype since around version 2.1.3 includes FT_Stroker. This
module is supposed to draw the stroke (another word for the outline we
want) based on the vector outlines (this "outline" is a different one)
of the font. The only usage of this modul is the titler plugin of the
cinelerra project. However in my own experiments with freetype 2.1.4
this ftstroker modul was buggy (it misses the outlines of the right
side).

ImageMagick also has a stroke feature. The implementation is very
similar to the ftstroker (decompose the outline of the glyph into
Bezier curves and lines and draw these onto a bitmap) but is working.

A comparison of the methods is available at
http://freeciv.org/~rfalke/fs3_pics/outline.png. The first is drawed
by gui-fs with the halo method. The remaining items are drawn by
ImageMagick into the screenshot with various strokewidths. A
strokewidth of 1.5 is comparable to the halo-method. See
http://freeciv.org/~rfalke/fs3_pics/outline_contrast.png for an easy
comparison.

Even with the MUCH more complex methods used by ftstroker and
ImageMagick the results are comparable to the halo-method. The halo
method however only supports integral stroke widths.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "Just because you put a flag on the moon doesn't make it yours, it just
  puts a hole in the moon."




[Prev in Thread] Current Thread [Next in Thread]