freetype
[Top][All Lists]
Advanced

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

RE: [Freetype] rendering in mono


From: Turner, David
Subject: RE: [Freetype] rendering in mono
Date: Wed, 13 Oct 2004 10:56:13 +0200

> Hello,
> 
> i'm facing with a problem when i render in mono
> 
> what i want to do is rendering a string in mono, using 
> kerning. I want to blit the 1-bit glyph images onto a 1-bit bitmap.
> The problem is that it seems that when i use FT_Glyph_To_Bitmap with the
> correct origin vector, the resulting glyph images are not byte aligned, so
> that i have to do myself the blitting of the glyph image, by 
> manipulating the bits.
> 
Instead of using FT_Glyph_To_Bitmap, you can do the following when your
input glyph contains an outline:

  - typecast your FT_Glyph to a FT_OutlineGlyph, this will give
    you access to the internal FT_Outline used.

  - translate the corresponding outline to the correct origin

  - then render it with with FT_Outline_Get_Bitmap or FT_Outline_Render 
    into your target bitmap directly

  - translate the outline back to its previous position.

that's basically what FT_Glyph_To_Bimap does for you, except that it
also allocates a new FT_Glyph and the corresponding bitmap buffer.

This should solve your problem nicely.

> Indeed, it the glyph images were byte aligned, only a "or" 
> could be used to blit my glyph images.
> 
> In the note of FT_Glyph_To_Bitmap, it is said "The glyph image is
> translated with the `origin' vector before rendering." Does this only
> occur in normal rendering ? What is done in mono rendering ?
> 
Sorry, you should ask the Mono maintainers.

> So, am i wrong in my above statements (that is, my test prog is 
> wrong) ? Am i right and there's a straightforward solution for that
> problem ? Or no solution and i have to manipulate bits myself ?
> 
> i hope i was clear :)
> 

Hope this helps,

- David Turner
- The FreeType Project  (www.freetype.org)

> Thank you !
> 
> Vincent TORRI
> 
> PS: is there an irc channel for freetype ?
> 
Nope, we don't have time for this. Besides, we're disconnected from the
net most of the time :-)



reply via email to

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