[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Pnet-developers] Draw Text outlined
From: |
Marc Haisenko |
Subject: |
Re: [Pnet-developers] Draw Text outlined |
Date: |
Tue, 25 Apr 2006 09:43:45 +0200 |
User-agent: |
KMail/1.8.1 |
On Tuesday 25 April 2006 08:02, address@hidden wrote:
> Hi All,
>
> I need to draw a text outlined with no filling (transparent).
>
> See image.
> <<outline.jpg>>
>
> Do someone know, how I can do this with Xlib?
>
> TIA
>
> Heiko
You could possibly fake it, though this would be rather slow and very
primitive (e.g. the outline resulting from this code would be one pixel
thick):
Pseudo-code:
double offset = 0.0;
foreach (char c in text)
{
double width = MeasureString(c).Width;
DrawChar(x + offset - 1, y - 1, c, outlineColor);
DrawChar(x + offset + 1, y - 1, c, outlineColor);
DrawChar(x + offset - 1, y + 1, c, outlineColor);
DrawChar(x + offset + 1, y + 1, c, outlineColor);
DrawChar(x + offset, y, c, inlineColor);
offset += width;
}
--
Marc Haisenko
http://darkdust.net
Today is Setting Orange, the 42nd day of Discord in the YOLD 3172
pgp8TjA_AOgDf.pgp
Description: PGP signature