[WK2] Small Caps font variant issue for Italic fonts
authorTanvir <tanvir.rizvi@samsung.com>
Tue, 28 May 2013 15:07:27 +0000 (20:37 +0530)
committerTanvir <tanvir.rizvi@samsung.com>
Fri, 12 Jul 2013 11:38:50 +0000 (17:08 +0530)
[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
Source/WebCore/platform/graphics/freetype/FontCacheFreeType.cpp

index f8c6503..f78e14b 100755 (executable)
 #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 <hyunki.baik@samsung.com> */
 #define ENABLE_TIZEN_ON_AUTHENTICATION_REQUESTED 1 /* Sungman Kim(ssungmai.kim@samsung.com) : Implement to requested authentication signal handling method */
index bd44a86..9b8b822 100755 (executable)
@@ -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()))