freetype
[Top][All Lists]
Advanced

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

[ft] Clipping Of Empty Glyphs (space)


From: Mickey Gabel
Subject: [ft] Clipping Of Empty Glyphs (space)
Date: Wed, 04 Jun 2008 11:38:26 +0300
User-agent: Thunderbird 2.0.0.14 (Windows/20080421)

Hi all,

I am writing a text rendering library based on FreeType 2.3.5. and encountered some problems.

One of the problems I encountered was translation of "empty" glyphs like the space character ' '.

        // assume chacater is loaded and copied to glyph[i]
        FT_Glyph_Transform( glyph[i], NULL, &pen_pos[i] );  
        FT_Glyph_Get_CBox( glyph[i], FT_GLYPH_BBOX_PIXELS, &bbox );
        FT_Glyph_To_Bitmap( glyph[i], FT_RENDER_MODE_NORMAL, NULL, 1 );
        DrawBitmap( (FT_BitmapGlyph)glyph[i], clip_region, ... );

I also do some clipping in DrawBitmap(). Everything works just fine so far, including clipping, mostly.

My goal is to determine if a glyph is inside the clip region, or outside, or partially clipped. It works fine for most glyphs. However for empty glyphs like ' ' it seems that the CBox (bbox) is all zeros, and the bitmap->left and bitmap->top are also some unrelated value that ignores the transform I set. For ' ' I was sort of expecting a bbox with height 0 but with a real width and position.

Even if these characters don't need to be drawn anyway, I need to determine if they are inside the clip_region.
How do I do that?


Thanks,
        Mickey






reply via email to

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