tasn pushed a commit to branch evas-1.7.
commit 684bace5114c18e29f816c6f64981f621971fccb
Author: Tom Hacohen <[email protected]>
Date: Thu Apr 4 16:10:30 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/engines/common/evas_font_load.c | 9 ++++++++-
3 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/ChangeLog b/ChangeLog
index d5ba928..1ec651b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1232,3 +1232,8 @@
2013-03-04 Cedric Bail
* Fix crash in Evas Buffer engine when using output without alpha
channel.
+
+2013-04-04 Tom Hacohen
+
+ * Evas font: If OS/2 table is available and the font is demi-bold,
+ don't do runtime emboldment.
diff --git a/NEWS b/NEWS
index ec96185..85ccb3f 100644
--- a/NEWS
+++ b/NEWS
@@ -19,6 +19,7 @@ Fixes:
* Evas cache: remove the freed worker from the pthread worker list when
it's failed to create a new thread so as not to access it if a thread is
working newly.
* Fix evas word start/end find in textblock to be consistent with other
toolkit logic on the matter
* Fix crash in Evas Buffer engine when using output with no alpha.
+ * Evas font: If OS/2 table is available and the font is demi-bold, don't
do runtime emboldment.
Changes since Evas 1.7.5:
-------------------------
diff --git a/src/lib/engines/common/evas_font_load.c
b/src/lib/engines/common/evas_font_load.c
index 3e0cf1c..805eaf8 100644
--- a/src/lib/engines/common/evas_font_load.c
+++ b/src/lib/engines/common/evas_font_load.c
@@ -5,6 +5,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"
@@ -492,7 +493,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