plugin api change: Plugins() and main functions must receive (and possibly ignore...
[enigma2.git] / lib / gdi / font.cpp
index b1b4fa99bf262ea0641e0b4454ad9cbff0538f7f..4c08b4fcf4e9742f13835888da2150482435d2cd 100644 (file)
@@ -18,7 +18,7 @@
 #include <lib/base/init.h>
 #include <lib/base/init_num.h>
 
-//#define HAVE_FRIBIDI
+#define HAVE_FRIBIDI
 // until we have it in the cdk
 
 #ifdef HAVE_FRIBIDI
@@ -206,11 +206,9 @@ float fontRenderClass::getLineHeight(const gFont& font)
        }
        int linegap=current_face->size->metrics.height-(current_face->size->metrics.ascender+current_face->size->metrics.descender);
        float height=(current_face->size->metrics.ascender+current_face->size->metrics.descender+linegap)/64.0;
-       delete fnt;
        return height;
 }
 
-
 fontRenderClass::~fontRenderClass()
 {
        singleLock s(ftlock);
@@ -363,7 +361,7 @@ void eTextPara::calc_bbox()
        boundBox = i->bbox; 
        ++i;
 
-       for (; i != glyphs.end(); ++i)
+       for (; i != glyphs.end(); ++i)
        {
                if ( i->flags & GS_ISSPACE )
                        continue;
@@ -408,6 +406,7 @@ void eTextPara::setFont(const gFont *font)
 }
 
 std::string eTextPara::replacement_facename;
+std::set<int> eTextPara::forced_replaces;
 
 void eTextPara::setFont(Font *fnt, Font *replacement)
 {
@@ -589,9 +588,10 @@ nprint:    isprintable=0;
                }
                if (isprintable)
                {
-                       FT_UInt index;
-
-                       index=(rflags&RS_DIRECT)? *i : FT_Get_Char_Index(current_face, *i);
+                       FT_UInt index = 0;
+                       
+                       if (forced_replaces.find(*i) == forced_replaces.end())
+                               index=(rflags&RS_DIRECT)? *i : FT_Get_Char_Index(current_face, *i);
 
                        if (!index)
                        {