[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Freetype] freetype tutorial & gdk/gtk
From: |
Michael Pfeiffer |
Subject: |
Re: [Freetype] freetype tutorial & gdk/gtk |
Date: |
Thu, 29 Aug 2002 15:13:57 +0200 |
>Any idea how to change the colours of the bitmap (fg/bg) ? Currently I
>get white letters on a black background. I've tried a few Gdk functions
>with not much joy.
I have no knowledge in GDK programming. In general you have the
following possibilities (at least):
1. RGBA-Bitmap
a) initialize the bitmap with the textColor
b) set the alpha channel of the bitmap to the glyph gray values
c) draw the bitmap with alpha blending
2. RGB-Bitmap
a)
for each glyphPixel in glyph
for each color channel do
destPixel.channel = (bg.channel * (255-glyphPixel) + textColor.channel *
glyphPixel) / 255
b) draw the RGB-Bitmap
destPixel is the corrseponding pixel to the glyphPixel in the RGB-bitmap
3. Blending with current background
same as RGB-Bitmap, but RGB-Bitmap is initialized with the current background
image that
the glyph overlaps.
- Michael