freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Devel] bitmap rendering


From: Achim Hasenmueller
Subject: [Devel] bitmap rendering
Date: Sat, 17 Feb 2001 22:19:05 +0100

Hi,

I am currently working on integrating Freetype2 into an application
as the font rendering engine. I specifically want the nice TrueType
quality and anti aliasing.

Now I have some problems. I have successfully compiled the current
CVS code and started to implement a test program so see how
rendering would fit into my system.

Unfortunately, I can't get it to render properly in my sample application.
Here is what I do:

error = FT_Init_FreeType(&library);
error = FT_New_Face(library, "tnr.pfb",  0, &face);
error = FT_Set_Char_Size(face, 0, 30 * 64, 300, 300);

char szString[20];
strcpy(szString, "a");
error = FT_Load_Char(face, szString, FT_LOAD_RENDER);

bitmapwidth = face->glyph->bitmap.width;
bitmapheight = face->glyph->bitmap.rows;
bitmapsize = bitmapwidth * bitmapheight;

Then I use the face->glyph->bitmap.buffer pointer
and blit the rectangle given by (0, 0, bitmapwidth, bitmapheight)
to the screen.

This works fine for some letters. Depending on the font,
some letters work fine, some look a bit distorted and other
are totally distorted. So my question is what could be wrong
about this code so that some letters are distorted. I also tried
some TrueType fonts such as Arial. There some characters
that were distorted look fine but others are distorted.

Second problem is that my target system has an inverse
coordinate system with (0, 0) being the bottom left. Therefore
I have to mirror the bitmap returned by FreeType. Is it anyhow
possible to tell FreeType to render the bitmap bottomup?

Thanks for any information! I will surely ask for more once
this is solved :-)

Kind regards / mit freundlichen Gruessen,
    Achim Hasenmueller

InnoTek Systemberatung GmbH
phon: +49 7151 9965-30
address@hidden
http://www.innotek.de
Germany





reply via email to

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