Robby
Tue Oct 07 21:30:01 CDT 2008
Hello Igor,
>Then you would need access to original vector description of the font
>characters at runtime - just as Word does. As in, a TTF file.
Okay, I opened up a TTF file, however, I wouldn't know How to read this file
in my MCU. However as you suggested below is exactly what I needed to know
and I really didn't think about it!
>Well, you could store an alpha channel - a matrix specifying the opacity
>for each pixel. You could write a program that figures out this opacity
>from Word-generated grayscale image. At runtime, you would mix the
>character image with the background using the opacity coefficients.
>In fact, now that I think of it, a grayscale image itself can be treated
>directly as an opacity map (a black pixel is fully opaque, a white one
>is fully transparent, a shade of gray between the two specifies the
>opacity level).
Except, instead of using the informations from a TTF file, I could copy over
the required characters from a character set in MS WORD and paste them in
Icon Lover with the antialiased pixels. For example when I copy the
characters from MS WORD to Icon Lover, they look like the "a" at the right at
this particular address:
http://www.widearea.co.uk/designer/anti.html
And once I have them all stored in memory like this, I can calculated the
opacity coeficients as you say for any background to foreground colors!
I think this will work but I will require more processing speed!
>Well, there are rendering engines that do that - see e.g.
>
http://freetype.sourceforge.net/index2.html
In this case, If I scan every pixel and calculate their opacity myself, I
wouldn't need a rendering engine right?
Thankyou Igor for your help!
If there is anything I missed, do get back!
--
Best regards
Roberto
"Igor Tandetnik" wrote:
> "Robby" <Robby@discussions.microsoft.com> wrote in message
> news:D92C426B-B925-4E6C-8D31-694AC1D606EA@microsoft.com
> >> You don't need rasterization - you seem to already have a raster
> >> font to begin with.
> >
> > I don't think so, because, I prepare my character set in a bitmap
> > editor, more precicely (Icon Lover) and by default it doesn't anti
> > alias the characters.
>
> That's precisely the point where the characters are rasterized
> (converted from vector description to a bitmap representation), and the
> information necessary for antialiasing is lost.
>
> > I copied a character from MS WORD into my bitmap editor (Icon Lover)
> > and the character appeared antialiased. I downloaded it and
> > displayed it. What a difference! Amazingly round and smooth
> > appearence. And I would like all my characters to appear this way,
> > but I have to do it in real time...
>
> Then you would need access to original vector description of the font
> characters at runtime - just as Word does. As in, a TTF file.
>
> > I really can't prepare my character sets from MS WORD in the way I
> > just described because when I copy over a character from MS WORD to
> > Icon Lover (as described above), it was already antialliased *but* in
> > respect to a white background. So when I displayed it on my small LCD
> > on a white background, it was amazing. However, displaying this same
> > character on a blue background, you would see a border of somewhat
> > white pixels on the contour of the letter. And this was unacceptable.
>
> Well, you could store an alpha channel - a matrix specifying the opacity
> for each pixel. You could write a program that figures out this opacity
> from Word-generated grayscale image. At runtime, you would mix the
> character image with the background using the opacity coefficients.
>
> In fact, now that I think of it, a grayscale image itself can be treated
> directly as an opacity map (a black pixel is fully opaque, a white one
> is fully transparent, a shade of gray between the two specifies the
> opacity level).
>
> > So I can't really download a sample of every letter antialliased to
> > every possible background color for every character set, this would
> > be very redundant and a waste of memory. Instead I download a simple
> > character set (true types I believe) fonts (white and black only)
>
> TrueType fonts aren't really black and white - they are vector fonts. A
> character in a vector font is, roughly, a set of instructions like "draw
> a straight line between these two points", "draw a chord of a circle
> with this center and this radius between these two angles" and so on.
> It's the job of a rendering engine to translate these instructions into
> pixel colors - this process is called rasterization. Nothing in the font
> file says the character must be drawn in black on white background.
>
> > and
> > need to rasterize or antiallias them myself as thay are required to
> > be displayed (at real time).
>
> Well, there are rendering engines that do that - see e.g.
>
>
http://freetype.sourceforge.net/index2.html
>
> Igor Tandetnik
>
>
>