[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Shadows and Borders
From: |
Adam Meyerowitz |
Subject: |
RE: Shadows and Borders |
Date: |
Mon, 11 Sep 2000 22:02:11 -0400 |
At 08:52 PM 9/11/00 -0400, Feinberg, Matthew wrote:
There's nothing built into FreeType that I know of, if that's what you
mean. IIRC, there was some talk a while ago on the list about stroking
glyph outlines -- you might try searching the mailing list archives, or
maybe someone else on the list can help.
What exactly do you mean by stroking the glyph outlines? I have implemented
shadowing and bordering before using glyph bitmaps but I don't think it is the
most elegant way, or maybe it was.
Basically I use a second buffer and for each pixel do a shadow or border.
For a border I move up and to the left border pixels and then draw a filled
rectangle
border*2+1 wide and high. Then I combine both buffers (the glyph and the
border
buffer) to make a single bordered character buffer. For a shadow I
basically do what
you mentioned for each pixel and then combine the two buffers.
This might be the only way, but I thought there might be some other more
interesting
ways.
Thanks for the response,
Adam
As for shadows, it depends what kind. The easiest thing is to draw the
text twice. First draw it in either a dark color or with alpha blending
(or both) to get the shadow, then draw it again in the foreground color
to get the text. You want to apply some kind of transformation to the
shadow when you draw it so it's not covered up by the text :o) The
simplest thing is to just to translate the shadow-- draw it a pixel or
two off to the side and down, then draw the text on top of it. With the
right transformations you could probably also create other kinds of
shadow styles.
--Matthew
> -----Original Message-----
> From: Adam Meyerowitz [mailto:address@hidden
> Sent: Monday, September 11, 2000 8:01 PM
> To: address@hidden
> Subject: Shadows and Borders
>
>
> Sorry if this is a repost. I am not sure it got around.
>
> Hello All,
>
> I am new to this list so excuse me if this has been asked
> before. Is there
> any mechanism to add
> shadows (extrusions), and borders to rendered glyphs. If
> there isn't, are
> there any know algorithms
> that can do this efficiently. I would consider coding them
> up if there are.
>
> Any help would be appreciated.
>
> Thanks
> Adam
>
- Shadows and Borders, Adam Meyerowitz, 2000/09/09
- Shadows and Borders, Adam Meyerowitz, 2000/09/12
- RE: Shadows and Borders, Feinberg, Matthew, 2000/09/12
- RE: Shadows and Borders,
Adam Meyerowitz <=
- RE: Shadows and Borders, Feinberg, Matthew, 2000/09/12
- RE: Shadows and Borders, Adam Meyerowitz, 2000/09/12