tasn pushed a commit to branch master.

commit 2da15ced6540799ae0e3109cae8dfefc73a6aa00
Author: Tom Hacohen <[email protected]>
Date:   Thu Apr 4 16:05:27 2013 +0100

    Evas font: Disable run-time emboldment in some cases.
    
    If OS/2 table is available and the font is demi-bold, don't do runtime
    emboldment.
---
 ChangeLog                            | 5 +++++
 NEWS                                 | 1 +
 src/lib/evas/common/evas_font_load.c | 9 ++++++++-
 3 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index e6e743b..86a88dd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-04-04  Tom Hacohen
+
+        * Evas font: If OS/2 table is available and the font is demi-bold,
+         don't do runtime emboldment.
+
 2013-04-04  Yakov Goldberg
 
         * Evas font: char position, returned by
diff --git a/NEWS b/NEWS
index 5cab2bc..a1cda47 100644
--- a/NEWS
+++ b/NEWS
@@ -221,3 +221,4 @@ Fixes:
     * Fix edje entry to respect filters and if input filtered out, don't clear 
selections
     * Fix evas buffer engine allocation with non alpha output
     * Evas font: click on left/right half of char does matter now.
+    * Evas font: If OS/2 table is available and the font is demi-bold, don't 
do runtime emboldment.
diff --git a/src/lib/evas/common/evas_font_load.c 
b/src/lib/evas/common/evas_font_load.c
index b1a6efd..9bdb10f 100644
--- a/src/lib/evas/common/evas_font_load.c
+++ b/src/lib/evas/common/evas_font_load.c
@@ -15,6 +15,7 @@
 
 #include "evas_font_private.h" /* for Frame-Queuing support */
 #include "evas_font_ot.h"
+#include <freetype/tttables.h> /* Freetype2 OS/2 font table. */
 
 #ifdef EVAS_CSERVE2
 # include "../cserve2/evas_cs2_private.h"
@@ -505,7 +506,13 @@ evas_common_font_int_load_complete(RGBA_Font_Int *fi)
 
    if ((fi->wanted_rend & FONT_REND_WEIGHT) &&
        !(fi->src->ft.face->style_flags & FT_STYLE_FLAG_BOLD))
-      fi->runtime_rend |= FONT_REND_WEIGHT;
+     {
+        TT_OS2 *tt_os2 = FT_Get_Sfnt_Table(fi->src->ft.face, ft_sfnt_os2);
+        if (!tt_os2 || (tt_os2->usWeightClass < 600))
+          {
+             fi->runtime_rend |= FONT_REND_WEIGHT;
+          }
+     }
 
    return fi;
 }

-- 

------------------------------------------------------------------------------
Minimize network downtime and maximize team effectiveness.
Reduce network management and security costs.Learn how to hire 
the most talented Cisco Certified professionals. Visit the 
Employer Resources Portal
http://www.cisco.com/web/learning/employer_resources/index.html

Reply via email to