From a7f58fe63f4c95526790d8d995384a22d7af8b4e Mon Sep 17 00:00:00 2001 From: Tanvir Date: Tue, 28 May 2013 20:37:27 +0530 Subject: [PATCH] [WK2] Small Caps font variant issue for Italic fonts [Version] N/A [Project] N/A [Title] Fix the smallcaps-italic combination issue [BinType] N/A [Customer] N/A [Issue#] N/A [Solution] The combination of small-caps and italic is synthesized. If there is a combination of smallcaps and italic then the fon cache will give the normal font and we will synthesize(skew) that font face. [Developer] tanvir.rizvi [Request] N/A [Horizontal expansion] N/A [SCM request] N/A Change-Id: Ib857cbd00b54f4644321bcebe0bbcb6dd16570e5 Conflicts: Source/WTF/wtf/Platform.h --- Source/WTF/wtf/Platform.h | 1 + Source/WebCore/platform/graphics/freetype/FontCacheFreeType.cpp | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/Source/WTF/wtf/Platform.h b/Source/WTF/wtf/Platform.h index f8c6503..f78e14b 100755 --- a/Source/WTF/wtf/Platform.h +++ b/Source/WTF/wtf/Platform.h @@ -442,6 +442,7 @@ #define ENABLE_TIZEN_FALLBACK_FONTDATA 1 /* Hyeonji Kim(hyeonji.kim@samsung.com) : Add the fallback fontData to FontFallbackList */ #define ENABLE_TIZEN_COLLECT_HARFBUZZRUN 1 /* Rashmi Shyamasundar(rashmi.s2@samsung.com) Create proper harfBuzzRun for a word which follows a space */ #define ENABLE_TIZEN_CANVAS_2D_LINE_JOIN 1 /* Rashmi Shyamasundar(rashmi.s2@samsung.com) Save the value of lineJoin in GraphicsContextState */ +#define ENABLE_TIZEN_FAKE_ITALIC_SMALLCAPS_COMBINATION 1 /* Tanvir Rizvi(tanvir.rizvi@samsung.com) Synthesize the small-caps and Italic combination */ #define ENABLE_TIZEN_CONTEXTSHADOW_BLUR_NEON 0 /* use neon shadowblur function in ContextShadow.cpp */ #define ENABLE_TIZEN_ON_AUTHENTICATION_REQUESTED 1 /* Sungman Kim(ssungmai.kim@samsung.com) : Implement to requested authentication signal handling method */ diff --git a/Source/WebCore/platform/graphics/freetype/FontCacheFreeType.cpp b/Source/WebCore/platform/graphics/freetype/FontCacheFreeType.cpp index bd44a86..9b8b822 100755 --- a/Source/WebCore/platform/graphics/freetype/FontCacheFreeType.cpp +++ b/Source/WebCore/platform/graphics/freetype/FontCacheFreeType.cpp @@ -218,8 +218,15 @@ FontPlatformData* FontCache::createFontPlatformData(const FontDescription& fontD return 0; bool italic = fontDescription.italic(); +#if ENABLE(TIZEN_FAKE_ITALIC_SMALLCAPS_COMBINATION) + bool smallCaps = fontDescription.smallCaps(); + if (!FcPatternAddInteger(pattern.get(), FC_SLANT, (italic && !smallCaps) ? FC_SLANT_ITALIC : FC_SLANT_ROMAN)) + return 0; +#else if (!FcPatternAddInteger(pattern.get(), FC_SLANT, italic ? FC_SLANT_ITALIC : FC_SLANT_ROMAN)) return 0; +#endif + if (!FcPatternAddInteger(pattern.get(), FC_WEIGHT, fontWeightToFontconfigWeight(fontDescription.weight()))) return 0; if (!FcPatternAddDouble(pattern.get(), FC_PIXEL_SIZE, fontDescription.computedPixelSize())) -- 2.7.4