Some truetype fonts include bitmap strikes for certain sizes. A new font
attribute is introduced to the DFBFontAttributes enum. It maps to
the FT_LOAD_NO_BITMAP attribute in the freetype2 renderer. This
tells the renderer to always provide an anti-aliased rendering,
ignoring bitmap strikes embedded in the font. For bitmap-only fonts this
flag is ignored.
---
 include/directfb.h                           |    5 +++-
 interfaces/IDirectFBFont/idirectfbfont_ft2.c |   31
+++++++++++++------------
 2 files changed, 20 insertions(+), 16 deletions(-)

diff --git a/include/directfb.h b/include/directfb.h
index 1f35997..bac7e4f 100644
--- a/include/directfb.h
+++ b/include/directfb.h
@@ -979,7 +979,10 @@ typedef enum {
      DFFA_MONOCHROME     = 0x00000004,  /* don't use anti-aliasing */
      DFFA_NOCHARMAP      = 0x00000008,  /* no char map, glyph indices
are
                                            specified directly */
-     DFFA_FIXEDCLIP      = 0x00000010   /* width fixed advance, clip to
it */
+     DFFA_FIXEDCLIP      = 0x00000010,  /* width fixed advance, clip to
it */
+     DFFA_NOBITMAP       = 0x00000020   /* ignore bitmap strikes; for
+                                           bitmap-only fonts this flag
is
+                                           ignored */
 } DFBFontAttributes;
 
 /*
diff --git a/interfaces/IDirectFBFont/idirectfbfont_ft2.c
b/interfaces/IDirectFBFont/idirectfbfont_ft2.c
index 6ad3a78..ae8c2c6 100644
--- a/interfaces/IDirectFBFont/idirectfbfont_ft2.c
+++ b/interfaces/IDirectFBFont/idirectfbfont_ft2.c
@@ -680,23 +680,22 @@ Probe( IDirectFBFont_ProbeContext *ctx )
 
 
 static DFBResult
-Construct( IDirectFBFont      *thiz,
+Construct( IDirectFBFont *thiz,
           ... )
 {
-     int                    i;
-     DFBResult              ret;
-     CoreFont              *font;
-     FT_Face                face;
-     FT_Error               err;
-     FT_Int                 load_flags = FT_LOAD_DEFAULT;
-     FT2ImplData           *data;
-     bool                   disable_charmap = false;
-     bool                   disable_kerning = false;
-     bool                   load_mono = false;
-     u32                    mask = 0;
-
-     CoreDFB *core;
-     char *filename;
+     int                 i;
+     DFBResult           ret;
+     CoreFont           *font;
+     FT_Face             face;
+     FT_Error            err;
+     FT_Int              load_flags = FT_LOAD_DEFAULT;
+     FT2ImplData        *data;
+     bool                disable_charmap = false;
+     bool                disable_kerning = false;
+     bool                load_mono = false;
+     u32                 mask = 0;
+     CoreDFB            *core;
+     char               *filename;
      DFBFontDescription *desc;
 
      va_list tag;
@@ -746,6 +745,8 @@ Construct( IDirectFBFont      *thiz,
      if (desc->flags & DFDESC_ATTRIBUTES) {
           if (desc->attributes & DFFA_NOHINTING)
                load_flags |= FT_LOAD_NO_HINTING;
+          if (desc->attributes & DFFA_NOBITMAP)
+               load_flags |= FT_LOAD_NO_BITMAP;
           if (desc->attributes & DFFA_NOCHARMAP)
                disable_charmap = true;
           if (desc->attributes & DFFA_NOKERNING)
-- 
1.5.6.3



_______________________________________________
directfb-dev mailing list
directfb-dev@directfb.org
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-dev

Reply via email to