aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Hacohen <tom@stosb.com>2013-04-04 16:05:27 +0100
committerTom Hacohen <tom@stosb.com>2013-04-04 16:05:42 +0100
commit2da15ced6540799ae0e3109cae8dfefc73a6aa00 (patch)
tree7434095986b7831b4c2aa30185abbbffc69ba55d
parenteina: add some more debug information. (diff)
downloadefl-2da15ced6540799ae0e3109cae8dfefc73a6aa00.tar.gz
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.
-rw-r--r--ChangeLog5
-rw-r--r--NEWS1
-rw-r--r--src/lib/evas/common/evas_font_load.c9
3 files changed, 14 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index e6e743bc62..86a88dd65f 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 5cab2bc092..a1cda47c90 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 b1a6efd622..9bdb10fe3a 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;
}