Title: [102915] trunk
Revision
102915
Author
[email protected]
Date
2011-12-15 03:57:05 -0800 (Thu, 15 Dec 2011)

Log Message

Supports Unicode variation selector
https://bugs.webkit.org/show_bug.cgi?id=50999

Reviewed by Nikolas Zimmermann.

Source/WebCore:

Adds SimpleFontData::updateGlyphWithVariationSelector() which substitutes the
glyph in question based on the selector. WidthIterator::advance() calls it
when an unicode variation selector follows the character.

Test: fast/text/unicode-variation-selector.html

* platform/graphics/SimpleFontData.h: Added updateGlyphWithVariationSelector().
* platform/graphics/SurrogatePairAwareTextIterator.cpp:
(WebCore::isUnicodeBMPVariationSelector): Added.
(WebCore::isUnicodeSupplementaryVariationSelector): Added.
(WebCore::SurrogatePairAwareTextIterator::hasTrailingVariationSelector): Added.
* platform/graphics/SurrogatePairAwareTextIterator.h:
* platform/graphics/WidthIterator.cpp:
(WebCore::WidthIterator::advance): Changed to detect variation selectors.
* platform/graphics/chromium/SimpleFontDataChromiumWin.cpp:
(WebCore::SimpleFontData::updateGlyphWithVariationSelector): Added.
* platform/graphics/chromium/SimpleFontDataLinux.cpp:
(WebCore::SimpleFontData::updateGlyphWithVariationSelector): Ditto.
* platform/graphics/freetype/SimpleFontDataFreeType.cpp:
(WebCore::SimpleFontData::updateGlyphWithVariationSelector): Ditto.
* platform/graphics/mac/SimpleFontDataMac.mm:
(WebCore::decomposeToUTF16): Ditto.
(WebCore::SimpleFontData::updateGlyphWithVariationSelector): Ditto.
* platform/graphics/pango/SimpleFontDataPango.cpp:
(WebCore::SimpleFontData::updateGlyphWithVariationSelector): Ditto.
* platform/graphics/qt/SimpleFontDataQt.cpp:
(WebCore::SimpleFontData::updateGlyphWithVariationSelector): Ditto.
* platform/graphics/win/SimpleFontDataWin.cpp:
(WebCore::SimpleFontData::updateGlyphWithVariationSelector): Ditto.
* platform/graphics/wince/SimpleFontDataWinCE.cpp:
(WebCore::SimpleFontData::updateGlyphWithVariationSelector): Ditto.
* platform/graphics/wx/SimpleFontDataWx.cpp:
(WebCore::SimpleFontData::updateGlyphWithVariationSelector): Ditto.

LayoutTests:

Add test for unicode variation selector support.
A tiny font (gw432047.ttf), which comes from glyphwiki.org and is used by Mozilla, is added for the test.

* fast/text/resources/gw432047-license.txt: Added.
* fast/text/resources/gw432047.ttf: Added.
* fast/text/unicode-variation-selector.html: Added.
* platform/chromium/test_expectations.txt: Added fast/text/unicode-variation-selector.html. This test need rebaseline.

Modified Paths

Added Paths

Property Changed

Diff

Modified: trunk/LayoutTests/ChangeLog (102914 => 102915)


--- trunk/LayoutTests/ChangeLog	2011-12-15 11:44:03 UTC (rev 102914)
+++ trunk/LayoutTests/ChangeLog	2011-12-15 11:57:05 UTC (rev 102915)
@@ -1,3 +1,18 @@
+2011-12-15  Kenichi Ishibashi  <[email protected]>
+
+        Supports Unicode variation selector
+        https://bugs.webkit.org/show_bug.cgi?id=50999
+
+        Reviewed by Nikolas Zimmermann.
+
+        Add test for unicode variation selector support.
+        A tiny font (gw432047.ttf), which comes from glyphwiki.org and is used by Mozilla, is added for the test.
+
+        * fast/text/resources/gw432047-license.txt: Added.
+        * fast/text/resources/gw432047.ttf: Added.
+        * fast/text/unicode-variation-selector.html: Added.
+        * platform/chromium/test_expectations.txt: Added fast/text/unicode-variation-selector.html. This test need rebaseline.
+
 2011-12-15  Alexander Pavlov  <[email protected]>
 
         [v8] Expose the "filter" property in V8CSSStyleDeclaration
Property changes on: trunk/LayoutTests/ChangeLog
___________________________________________________________________

Deleted: svn:executable

Added: trunk/LayoutTests/fast/text/resources/gw432047-license.txt (0 => 102915)


--- trunk/LayoutTests/fast/text/resources/gw432047-license.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/text/resources/gw432047-license.txt	2011-12-15 11:57:05 UTC (rev 102915)
@@ -0,0 +1,11 @@
+<http://en.glyphwiki.org/wiki/GlyphWiki:License>
+'''This document is a direct translation of the October 8th, 2008 revision of the Japanese original at ([[GlyphWiki:データ・記事のライセンス]]). This translation is provided as a service, and should not be taken to be a definitive statement. Please be aware that in case the Japanese original and the English version differ, the Japanese original takes precedence.'''
+
+*Data and article usage licence
+
+The glyphs registered at the GlyphWiki, as well as the articles, can be freely used by anyone. Reuse of this data, such as reproduction or modification of the glyps, is permitted. The are no specific restrictions with regards to displaying the author's name. Reuse of GlyphWiki data as the basis for a new font, or direct usage of fonts and glyphs copied from GlyphWiki in published work is allowed. GlyphWiki does not hold copyright on any citations used throughout GlyphWiki articles. Please consult their respective licences when reusing such content.
+
+<http://glyphwiki.org/wiki/GlyphWiki:%E3%83%87%E3%83%BC%E3%82%BF%E3%83%BB%E8%A8%98%E4%BA%8B%E3%81%AE%E3%83%A9%E3%82%A4%E3%82%BB%E3%83%B3%E3%82%B9>
+*データ及び記事のライセンス
+
+グリフウィキに登録されているグリフデータおよび記事は、誰もが自由に利用できることとします。複製、改変などの二次利用を認めるものとします。著作者表示も特に制限を設けません。新しいフォントのベースデータとして用いることや、そのままコピーしたものをフォントとして著作物とすることを妨げません。記事中に引用されている部分については、グリフウィキには著作権はありませんので引用元のライセンスを確認してください。

Added: trunk/LayoutTests/fast/text/resources/gw432047.ttf (0 => 102915)


--- trunk/LayoutTests/fast/text/resources/gw432047.ttf	                        (rev 0)
+++ trunk/LayoutTests/fast/text/resources/gw432047.ttf	2011-12-15 11:57:05 UTC (rev 102915)
@@ -0,0 +1,88 @@
+FFTMO GDEF'<GSUB\xF6\xF0U\VOS/2V\xB3l\xA5\x98Vcmap\xA0Ih\xF0cvt \xF0fpgm2Jf\x98\xC7gaspglyf\x814\xB7\xF6\xA4head\xF2\x9B?\xA36hhea\x97\xB7T$hmtx\x84\xCE\xF0loca\x9E\xF4maxpox name\xF1\xEE\x94(\xB0\xF0postE\xA2\xA3\xA0sprep\x9A6\xC3!\xC8(\xFEf/_<\xF5\xC7\xC2\xFD\xC8\xC7\xC2\xFD\xC8"\xFF\xB1\xD4ee\xFF\xB1\\xD4
+\xA5	\xC7\xF4\x99\xCC\x8F\x99\xCC\xEB3		
+PfEd@ \xFF\xFFp\xFFp\eO"2,,,N,4l\xB8\xEA4
+l8
+ N\x84[\xE0\xFF\xFF N\x84[\xE0\xFF\xFF\xFF\xE3\xB2{\xAA L  NN\x84[\x84[\xE0\xE0\x9F\x9F2 )\x84[	\x84[\xB0,\xB0K\xB0*PX\xB0JvY\xB0#?\xB0+X=YK\xB0*PX}Y ԰.-\xB0,  \xDA/\xB0+\X  G#Faj X db8!!Y!Y-\xB0,KRXE#Y!-\xB0,i \xB0@PX!\xB0@Y-\xB0,\xB0+X!#!zX\xDD\xCDYKRXX\xFD\xEDY#!\xB0+X\xB0FvYX\xDD\xCDYYY-\xB0,
+\Z-\xB0,\xB1"\x88PX\xB0 \x88\\\xB0Y-\xB0,\xB1$\x88PX\xB0@\x88\\\xB0Y-\xB0, 9/-\xB8\xFF\x85K\xB0PX\xB1\x8EY\xB1F+X!\xB0YK\xB0RX!\xB0\x80Y\xB0+\XY$\xFC\xD0\xA8\xFE\xD2"2\xAA3!'3#"\xEE\xCC\xCC\xAA\xFDV"f2\x9C\xCE\xE77!5X6@\xFCd\xB166,\xFF\xB1\xD4e\x86\x8A\xA4%7/'?!'?#!75!'!7#5'53?'!!5!37%5!37!5#5!5!535f*
+"%!0'	:'$
+0\xFEB@(*-LE=K@@\xC4 ;A\xFE\xB6\xDE ;
+
+
+
+lt
+\xFEB.Ud\xFE<Zh\xFE<\xA4\xA66A\xFE\xE3A\xECA\xFE\xE3A\xECA'*
+
+''
+)A 868
+& _ 0\xD9 +1	)%$!	 
+ "%7\x83k]]o]]AF55L lL lf
+Ff,\xFF\xB5\xD4e|\x83\x87\xA1%!/	5'?#!75!#!7#5'53?5!?'3!73%!5!37%5!37!5#5!5!535\xA2
+
+\xFE\xA8
+
+	0(*-L$@5K@@\xC4 ;A\xFE\xB6'\xDC ;
+	
+
+
+ks	
+
+
+\xFE##|$A:/<!F&')*
+9\xFE\xC6e\xFE<Yi\xFE<\xA4\xA66A\xFE\xE3A\xECA\xFE\xE3A\xECAA
+	
+
+
+
+n 99;& _ 0\xD9 +-1
+)&#"  "%
+?(
+
+2
+\x86\xCB]]o]]AF55L lL lf
+Ff,\xFF\xB1\xD4e\x86\x8A\xA4%7/'?!'?#!75!'!7#5'53?'!!5!37%5!37!5#5!5!535f*
+"%!0'	:'$
+0\xFEB@(*-LE=K@@\xC4 ;A\xFE\xB6\xDE ;
+
+
+
+lt
+\xFEB.Ud\xFE<Zh\xFE<\xA4\xA66A\xFE\xE3A\xECA\xFE\xE3A\xECA'*
+
+''
+)A 868
+& _ 0\xD9 +1	)%$!	 
+ "%7\x83k]]o]]AF55L lL lf
+FfN\xFF\xC8\xD0J'37%!/	'7?3!73%#375#\x9E
+
+\xFE\xD8
+
+	\x99\x9EA\xF7(L\xFE\x91	\xFD\x80\x9B@@\x9B ;@\x9B
+
+
+\x88%&\x8E
+\xFE\xA2;@%W\xFEb\x86J@!s!0\xFE V\xC6\xFE:,\xFF\xB5\xD4e|\x83\x87\xA1%!/	5'?#!75!#!7#5'53?5!?'3!73%!5!37%5!37!5#5!5!535\xA2
+
+\xFE\xA8
+
+	0(*-L$@5K@@\xC4 ;A\xFE\xB6'\xDC ;
+	
+
+
+ks	
+
+
+\xFE##|$A:/<!F&')*
+9\xFE\xC6e\xFE<Yi\xFE<\xA4\xA66A\xFE\xE3A\xECA\xFE\xE3A\xECAA
+	
+
+
+
+n 99;& _ 0\xD9 +-1
+)&#"  "%
+?(
+
+2
+\x86\xCB]]o]]AF55L lL lf
+Ff&-\\x9C\xB5%	Q\x84\xA76	E_\x85\xB9	Z	\x8A	\xA5	J\xBD	 /	 b	\x95N\xB07Og \x97Created by GlyphWiki. (http://glyphwiki.org/)Created by GlyphWiki. (http://glyphwiki.org/)gw432047gw432047RegularRegularFontForge 2.0 : basefont : 17-11-2009FontForge 2.0 : basefont : 17-11-2009gw432047 Regulargw432047 Regular0.01; (gw432047)0.01; (gw432047)gw432047gw4320470\xB00\xEA0\xD50\xA60\xA30\xAD0gO\b0U0\x8C0~0W0_0 (http://glyphwiki.org/)\x83O\x83\x8A\x83t\x83E\x83B\x83L\x82ō쐬\x82\xB3\x82\xEA\x82܂\xB5\x82\xBD\x81B (http://glyphwiki.org/)IVS0\xC60\xB90\xC8IVS\x83e\x83X\x83gRegularRegularIVS0\xC60\xB90\xC8 RegularIVS\x83e\x83X\x83g Regular0.01; (gw432047)0.01; (gw432047)\xFFp0
+	glyph1glyph2uni4E00uni845BuniE000uniE001u20B9Fu10C000	\xFF\xFF\xC4>\x8B\xEE\xC3\xED\xDC\xC7\xC2\xFD\xC8	
+0>DFLThanghanikana\xFF\xFFaalt
\ No newline at end of file

Added: trunk/LayoutTests/fast/text/unicode-variation-selector.html (0 => 102915)


--- trunk/LayoutTests/fast/text/unicode-variation-selector.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/unicode-variation-selector.html	2011-12-15 11:57:05 UTC (rev 102915)
@@ -0,0 +1,20 @@
+<style>
+@font-face {
+    font-family: ivsfont;
+    src: url(resources/gw432047.ttf);
+}
+.ivs {
+    font-family: ivsfont;
+}
+</style>
+<p>
+This page ensures that WebKit can render unicode variation selector correctly.  On platforms which support UVSes, the glyphs of U+845B should be different. On platforms which don't support UVSes, they should be identical.  In addition, any glyphs (including the last resort glyph) should not appear after the U+845B on all platforms.
+</p>
+<div>
+Glyph for code point U+845B without UVS:
+<span style="font-family: ivsfont;">&#x845b;</span>
+</div>
+<div>
+Glyph for code point U+845B with UVS:
+<span style="font-family: ivsfont;" id='ivs-holder'>&#x845b;&#xE0100;</span>
+</div>

Modified: trunk/LayoutTests/platform/chromium/test_expectations.txt (102914 => 102915)


--- trunk/LayoutTests/platform/chromium/test_expectations.txt	2011-12-15 11:44:03 UTC (rev 102914)
+++ trunk/LayoutTests/platform/chromium/test_expectations.txt	2011-12-15 11:57:05 UTC (rev 102915)
@@ -4007,3 +4007,6 @@
 BUGWK68859 DEBUG : fast/dynamic/crash-paint-no-documentElement-renderer.html = CRASH
 
 BUGWK74555 : fast/images/move-image-to-new-document.html = TEXT TIMEOUT
+
+// Need rebaseline on Mac.
+BUGWK50999 : fast/text/unicode-variation-selector.html = MISSING FAIL

Modified: trunk/Source/WebCore/ChangeLog (102914 => 102915)


--- trunk/Source/WebCore/ChangeLog	2011-12-15 11:44:03 UTC (rev 102914)
+++ trunk/Source/WebCore/ChangeLog	2011-12-15 11:57:05 UTC (rev 102915)
@@ -1,3 +1,44 @@
+2011-12-15  Kenichi Ishibashi  <[email protected]>
+
+        Supports Unicode variation selector
+        https://bugs.webkit.org/show_bug.cgi?id=50999
+
+        Reviewed by Nikolas Zimmermann.
+
+        Adds SimpleFontData::updateGlyphWithVariationSelector() which substitutes the
+        glyph in question based on the selector. WidthIterator::advance() calls it
+        when an unicode variation selector follows the character.
+
+        Test: fast/text/unicode-variation-selector.html
+
+        * platform/graphics/SimpleFontData.h: Added updateGlyphWithVariationSelector().
+        * platform/graphics/SurrogatePairAwareTextIterator.cpp:
+        (WebCore::isUnicodeBMPVariationSelector): Added.
+        (WebCore::isUnicodeSupplementaryVariationSelector): Added.
+        (WebCore::SurrogatePairAwareTextIterator::hasTrailingVariationSelector): Added.
+        * platform/graphics/SurrogatePairAwareTextIterator.h:
+        * platform/graphics/WidthIterator.cpp:
+        (WebCore::WidthIterator::advance): Changed to detect variation selectors.
+        * platform/graphics/chromium/SimpleFontDataChromiumWin.cpp:
+        (WebCore::SimpleFontData::updateGlyphWithVariationSelector): Added.
+        * platform/graphics/chromium/SimpleFontDataLinux.cpp:
+        (WebCore::SimpleFontData::updateGlyphWithVariationSelector): Ditto.
+        * platform/graphics/freetype/SimpleFontDataFreeType.cpp:
+        (WebCore::SimpleFontData::updateGlyphWithVariationSelector): Ditto.
+        * platform/graphics/mac/SimpleFontDataMac.mm:
+        (WebCore::decomposeToUTF16): Ditto.
+        (WebCore::SimpleFontData::updateGlyphWithVariationSelector): Ditto.
+        * platform/graphics/pango/SimpleFontDataPango.cpp:
+        (WebCore::SimpleFontData::updateGlyphWithVariationSelector): Ditto.
+        * platform/graphics/qt/SimpleFontDataQt.cpp:
+        (WebCore::SimpleFontData::updateGlyphWithVariationSelector): Ditto.
+        * platform/graphics/win/SimpleFontDataWin.cpp:
+        (WebCore::SimpleFontData::updateGlyphWithVariationSelector): Ditto.
+        * platform/graphics/wince/SimpleFontDataWinCE.cpp:
+        (WebCore::SimpleFontData::updateGlyphWithVariationSelector): Ditto.
+        * platform/graphics/wx/SimpleFontDataWx.cpp:
+        (WebCore::SimpleFontData::updateGlyphWithVariationSelector): Ditto.
+
 2011-12-15  Alexander Pavlov  <[email protected]>
 
         [v8] Expose the "filter" property in V8CSSStyleDeclaration
Property changes on: trunk/Source/WebCore/ChangeLog
___________________________________________________________________

Deleted: svn:executable

Modified: trunk/Source/WebCore/platform/graphics/SimpleFontData.h (102914 => 102915)


--- trunk/Source/WebCore/platform/graphics/SimpleFontData.h	2011-12-15 11:44:03 UTC (rev 102914)
+++ trunk/Source/WebCore/platform/graphics/SimpleFontData.h	2011-12-15 11:57:05 UTC (rev 102915)
@@ -158,6 +158,7 @@
 
     const GlyphData& missingGlyphData() const { return m_missingGlyphData; }
     void setMissingGlyphData(const GlyphData& glyphData) { m_missingGlyphData = glyphData; }
+    void updateGlyphWithVariationSelector(UChar32 character, UChar32 selector, Glyph&) const;
 
 #ifndef NDEBUG
     virtual String description() const;

Modified: trunk/Source/WebCore/platform/graphics/SurrogatePairAwareTextIterator.cpp (102914 => 102915)


--- trunk/Source/WebCore/platform/graphics/SurrogatePairAwareTextIterator.cpp	2011-12-15 11:44:03 UTC (rev 102914)
+++ trunk/Source/WebCore/platform/graphics/SurrogatePairAwareTextIterator.cpp	2011-12-15 11:57:05 UTC (rev 102915)
@@ -32,6 +32,21 @@
 
 namespace WebCore {
 
+inline static bool isUnicodeBMPVariationSelector(UChar character)
+{
+    return (0x180B <= character && character <= 0x180D) || (0xFE00 <= character && character <= 0xFE0F);
+}
+
+inline static bool isUnicodeSupplementaryVariationSelector(UChar lead, UChar trail)
+{
+    // A non-BMP variation selector character is in the range of U+E0100 to U+E01EF.
+    // It can be a surrogate pair in which the high surrogate is 0xDB40 and
+    // the low surrogate is in the range of U16_TRAIL(0xE0100 - 0x10000) to U16_TRAIL(0xE01EF - 0x10000).
+    static const UChar trailStart = U16_TRAIL(0xE0100 - 0x10000);
+    static const UChar trailEnd = U16_TRAIL(0xE01EF - 0x10000);
+    return lead == 0xDB40 && trailStart <= trail && trail <= trailEnd;
+}
+
 SurrogatePairAwareTextIterator::SurrogatePairAwareTextIterator(const UChar* characters, int currentCharacter, int lastCharacter, int endCharacter)
     : m_characters(characters)
     , m_currentCharacter(currentCharacter)
@@ -83,6 +98,21 @@
     return true;
 }
 
+bool SurrogatePairAwareTextIterator::hasTrailingVariationSelector(UChar32& selector, unsigned& clusterLength)
+{
+    if (static_cast<int>(m_currentCharacter + clusterLength) < m_endCharacter && isUnicodeBMPVariationSelector(m_characters[clusterLength])) {
+        selector = m_characters[clusterLength];
+        clusterLength += 1;
+        return true;
+    }
+    if (static_cast<int>(m_currentCharacter + clusterLength + 1) < m_endCharacter && isUnicodeSupplementaryVariationSelector(m_characters[clusterLength], m_characters[clusterLength + 1])) {
+        selector = U16_GET_SUPPLEMENTARY(m_characters[clusterLength], m_characters[clusterLength + 1]);
+        clusterLength += 2;
+        return true;
+    }
+    return false;
+}
+
 void SurrogatePairAwareTextIterator::advance(unsigned advanceLength)
 {
     m_characters += advanceLength;

Modified: trunk/Source/WebCore/platform/graphics/SurrogatePairAwareTextIterator.h (102914 => 102915)


--- trunk/Source/WebCore/platform/graphics/SurrogatePairAwareTextIterator.h	2011-12-15 11:44:03 UTC (rev 102914)
+++ trunk/Source/WebCore/platform/graphics/SurrogatePairAwareTextIterator.h	2011-12-15 11:57:05 UTC (rev 102915)
@@ -32,6 +32,7 @@
     SurrogatePairAwareTextIterator(const UChar*, int currentCharacter, int lastCharacter, int endCharacter);
 
     bool consume(UChar32& character, unsigned& clusterLength);
+    bool hasTrailingVariationSelector(UChar32& selector, unsigned& clusterLength);
     void advance(unsigned advanceLength);
 
     int currentCharacter() const { return m_currentCharacter; }

Modified: trunk/Source/WebCore/platform/graphics/WidthIterator.cpp (102914 => 102915)


--- trunk/Source/WebCore/platform/graphics/WidthIterator.cpp	2011-12-15 11:44:03 UTC (rev 102914)
+++ trunk/Source/WebCore/platform/graphics/WidthIterator.cpp	2011-12-15 11:57:05 UTC (rev 102915)
@@ -115,6 +115,13 @@
 
         ASSERT(fontData);
 
+        // If a variation selector follows, update glyph with the selector if possible.
+        UChar32 selector = 0;
+        if (textIterator.hasTrailingVariationSelector(selector, clusterLength)) {
+            fontData->updateGlyphWithVariationSelector(character, selector, glyph);
+            advanceLength = clusterLength;
+        }
+
         // Now that we have a glyph and font data, get its width.
         float width;
         if (character == '\t' && m_run.allowTabs()) {

Modified: trunk/Source/WebCore/platform/graphics/chromium/SimpleFontDataChromiumWin.cpp (102914 => 102915)


--- trunk/Source/WebCore/platform/graphics/chromium/SimpleFontDataChromiumWin.cpp	2011-12-15 11:44:03 UTC (rev 102914)
+++ trunk/Source/WebCore/platform/graphics/chromium/SimpleFontDataChromiumWin.cpp	2011-12-15 11:57:05 UTC (rev 102915)
@@ -199,4 +199,9 @@
     return static_cast<float>(width);
 }
 
+void SimpleFontData::updateGlyphWithVariationSelector(UChar32 character, UChar32 selector, Glyph& glyph) const
+{
+    // FIXME: Implement.
+}
+
 }  // namespace WebCore

Modified: trunk/Source/WebCore/platform/graphics/chromium/SimpleFontDataLinux.cpp (102914 => 102915)


--- trunk/Source/WebCore/platform/graphics/chromium/SimpleFontDataLinux.cpp	2011-12-15 11:44:03 UTC (rev 102914)
+++ trunk/Source/WebCore/platform/graphics/chromium/SimpleFontDataLinux.cpp	2011-12-15 11:57:05 UTC (rev 102915)
@@ -237,4 +237,9 @@
     return round(SkScalarToFloat(width));
 }
 
+void SimpleFontData::updateGlyphWithVariationSelector(UChar32 character, UChar32 selector, Glyph& glyph) const
+{
+    // FIXME: Implement.
+}
+
 }  // namespace WebCore

Modified: trunk/Source/WebCore/platform/graphics/freetype/SimpleFontDataFreeType.cpp (102914 => 102915)


--- trunk/Source/WebCore/platform/graphics/freetype/SimpleFontDataFreeType.cpp	2011-12-15 11:44:03 UTC (rev 102914)
+++ trunk/Source/WebCore/platform/graphics/freetype/SimpleFontDataFreeType.cpp	2011-12-15 11:57:05 UTC (rev 102915)
@@ -162,4 +162,9 @@
     return w;    
 }
 
+void SimpleFontData::updateGlyphWithVariationSelector(UChar32 character, UChar32 selector, Glyph& glyph) const
+{
+    // FIXME: Implement.
 }
+
+}

Modified: trunk/Source/WebCore/platform/graphics/mac/SimpleFontDataMac.mm (102914 => 102915)


--- trunk/Source/WebCore/platform/graphics/mac/SimpleFontDataMac.mm	2011-12-15 11:44:03 UTC (rev 102914)
+++ trunk/Source/WebCore/platform/graphics/mac/SimpleFontDataMac.mm	2011-12-15 11:57:05 UTC (rev 102915)
@@ -467,4 +467,32 @@
     return true;
 }
 
+static inline void decomposeToUTF16(UChar* buffer, unsigned& length, const UChar32 character)
+{
+    if (U_IS_BMP(character)) {
+        buffer[length] = character;
+        ++length;
+        return;
+    }
+
+    buffer[length] = U16_LEAD(character);
+    buffer[length + 1] = U16_TRAIL(character);
+    length += 2;
+}
+
+void SimpleFontData::updateGlyphWithVariationSelector(UChar32 character, UChar32 selector, Glyph& glyph) const
+{
+    unsigned length = 0;
+    UChar buffer[4];
+
+    decomposeToUTF16(buffer, length, character);
+    decomposeToUTF16(buffer, length, selector);
+    ASSERT(length <= 4);
+
+    CGGlyph glyphs[4];
+    wkGetGlyphsForCharacters(platformData().cgFont(), buffer, glyphs, length);
+    if (glyphs[0])
+        glyph = glyphs[0];
+}
+
 } // namespace WebCore

Modified: trunk/Source/WebCore/platform/graphics/pango/SimpleFontDataPango.cpp (102914 => 102915)


--- trunk/Source/WebCore/platform/graphics/pango/SimpleFontDataPango.cpp	2011-12-15 11:44:03 UTC (rev 102914)
+++ trunk/Source/WebCore/platform/graphics/pango/SimpleFontDataPango.cpp	2011-12-15 11:57:05 UTC (rev 102915)
@@ -160,4 +160,9 @@
     return width;    
 }
 
+void SimpleFontData::updateGlyphWithVariationSelector(UChar32 character, UChar32 selector, Glyph& glyph) const
+{
+    // FIXME: Implement.
 }
+
+}

Modified: trunk/Source/WebCore/platform/graphics/qt/SimpleFontDataQt.cpp (102914 => 102915)


--- trunk/Source/WebCore/platform/graphics/qt/SimpleFontDataQt.cpp	2011-12-15 11:44:03 UTC (rev 102914)
+++ trunk/Source/WebCore/platform/graphics/qt/SimpleFontDataQt.cpp	2011-12-15 11:57:05 UTC (rev 102915)
@@ -189,4 +189,9 @@
 {
 }
 
+void SimpleFontData::updateGlyphWithVariationSelector(UChar32 character, UChar32 selector, Glyph& glyph) const
+{
+    // FIXME: Implement.
 }
+
+}

Modified: trunk/Source/WebCore/platform/graphics/win/SimpleFontDataWin.cpp (102914 => 102915)


--- trunk/Source/WebCore/platform/graphics/win/SimpleFontDataWin.cpp	2011-12-15 11:44:03 UTC (rev 102914)
+++ trunk/Source/WebCore/platform/graphics/win/SimpleFontDataWin.cpp	2011-12-15 11:57:05 UTC (rev 102915)
@@ -282,4 +282,9 @@
     return m_scriptFontProperties;
 }
 
+void SimpleFontData::updateGlyphWithVariationSelector(UChar32 character, UChar32 selector, Glyph& glyph) const
+{
+    // FIXME: Implement.
 }
+
+}

Modified: trunk/Source/WebCore/platform/graphics/wince/SimpleFontDataWinCE.cpp (102914 => 102915)


--- trunk/Source/WebCore/platform/graphics/wince/SimpleFontDataWinCE.cpp	2011-12-15 11:44:03 UTC (rev 102914)
+++ trunk/Source/WebCore/platform/graphics/wince/SimpleFontDataWinCE.cpp	2011-12-15 11:57:05 UTC (rev 102915)
@@ -180,4 +180,9 @@
     m_maxCharWidth = (tm.tmMaxCharWidth * m_platformData.size() + 36) / 72;
 }
 
+void SimpleFontData::updateGlyphWithVariationSelector(UChar32 character, UChar32 selector, Glyph& glyph) const
+{
+    // FIXME: Implement.
+}
+
 } // namespace WebCore

Modified: trunk/Source/WebCore/platform/graphics/wx/SimpleFontDataWx.cpp (102914 => 102915)


--- trunk/Source/WebCore/platform/graphics/wx/SimpleFontDataWx.cpp	2011-12-15 11:44:03 UTC (rev 102914)
+++ trunk/Source/WebCore/platform/graphics/wx/SimpleFontDataWx.cpp	2011-12-15 11:57:05 UTC (rev 102915)
@@ -194,4 +194,9 @@
 }
 #endif
 
+void SimpleFontData::updateGlyphWithVariationSelector(UChar32 character, UChar32 selector, Glyph& glyph) const
+{
+    // FIXME: Implement.
 }
+
+}
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to