freetype
[Top][All Lists]
Advanced

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

Re: [ft] How to compare freetype API's with the ttf font tables


From: Werner LEMBERG
Subject: Re: [ft] How to compare freetype API's with the ttf font tables
Date: Thu, 21 Jan 2010 00:30:14 +0100 (CET)

>> > But the documents says it gives the bitmap conversion of the
>> > given character.  Please correct me if i am wrong.
>>
>> Well, yes.  As written in the file, you have to replace
>> `draw_bitmap' (and consequently `show_image') with something
>> useful.
>
> *You mean, the draw bitmap and show_image doesnt produce correct
> bitmap image?*

Well, it represents the bitmap roughly with ASCII characters (`*' and
`+'), thus it's not a `real' image.  If I change the font size of my
console to 4pt, disable line-wrapping, and maximize the window, I get
the attached result after some scrolling down and to the right.
Remember that the output of `example1' has 480 lines with a line
length of 640 characters each.

> *I tried the above and didnt get the correct bitmap for the given
> character.Attached the PNG.* If i increase the fontsize like 50 or
> so i can atleast makesure the output bitmap i am getting is E.

The default rendering of FreeType is anti-aliased with 255 gray
shades; the code in show image uses just two different characters to
represent them.  Of course you get strange results if the font size is
small...  Just try the `ftview' or `ftdiff' demo program and use a
magnifier glass to have a detailed look why this happens.

Try the B/W rasterizer instead.

> error = FT_Load_Char( face, text[n],FT_LOAD_RENDER );
>
> Load_Glyph and Load_Char both does the same right?

Not really.  Load_Char is a shorthand, applying a character map to the
input character code, then calling Load_Glyph on the resulting glyph
index.

> I am looking something like below: [...]

I simply don't have time to answer all those questions.  Please study
the demo programs (in the ft2demos bundle) in detail to get answers.


    Werner

PNG image


reply via email to

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