Commit 86470c87 authored by mitz@apple.com's avatar mitz@apple.com

<rdar://problem/8446709> Allow inter-ideograph justification for CJK

https://bugs.webkit.org/show_bug.cgi?id=53184

Reviewed by Dave Hyatt.

Source/WebCore: 

Tests: fast/text/justify-ideograph-complex.html
       fast/text/justify-ideograph-simple.html
       fast/text/justify-ideograph-vertical.html

* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::drawTextInternal): Corrected the type of the third parameter
passed to the TextRun constructor and added the trailingExpansionBehavior parameter.
* platform/graphics/Font.cpp:
(WebCore::Font::expansionOpportunityCount): Added. Returns the number of expansion opportunities
for text justification. On entry, isAfterExpansion says whether an expansion opportunity exists
before the first character. On return, isAfterExpansion says whether an expansion opportunity
exists after the last character.
* platform/graphics/Font.h: 
* platform/graphics/GlyphBuffer.h:
(WebCore::GlyphBuffer::expandLastAdvance): Added.
* platform/graphics/TextRun.h:
(WebCore::TextRun::TextRun): Added a TrailingExpansionBehavior parameter to the constructors.
Renamed padding to expansion.
(WebCore::TextRun::expansion): Renamed padding() to this.
(WebCore::TextRun::allowsTrailingExpansion): Added this accessor.
* platform/graphics/WidthIterator.cpp:
(WebCore::WidthIterator::WidthIterator): Initialize m_isAfterExpansion. Use Font::expansionOpportunityCount()
and adjust the count if it includes a trailing expansion opportunity but the run disallows trailing
expansion.
(WebCore::WidthIterator::advance): Apply expansion before and after CJK ideographs.
(WebCore::WidthIterator::advanceOneCharacter): Changed to not clear the GlyphBuffer so that advance()
can expand the last advance if it is followed by a CJK ideograph.
* platform/graphics/WidthIterator.h: Renamed m_padding to m_expansion and m_padPerSpace
to m_expansionPerOpportunity.
* platform/graphics/chromium/FontChromiumWin.cpp:
(WebCore::Font::canExpandAroundIdeographsInComplexText): Added.
* platform/graphics/chromium/FontLinux.cpp:
(WebCore::Font::canExpandAroundIdeographsInComplexText): Added.
* platform/graphics/efl/FontEfl.cpp:
(WebCore::Font::canExpandAroundIdeographsInComplexText): Added.
* platform/graphics/gtk/FontGtk.cpp:
(WebCore::Font::canExpandAroundIdeographsInComplexText): Added.
* platform/graphics/haiku/FontHaiku.cpp:
(WebCore::Font::canExpandAroundIdeographsInComplexText): Added.
* platform/graphics/mac/ComplexTextController.cpp:
(WebCore::ComplexTextController::ComplexTextController): Initialize m_isAfterExpansion. Use
Font::expansionOpportunityCount() and adjust the count if it includes a trailing expansion
opportunity but the run disallows trailing expansion.
(WebCore::ComplexTextController::adjustGlyphsAndAdvances): Moved the definition and initialization
of hasExtraSpacing outside the loop. Apply expansion before and after CJK ideographs.
* platform/graphics/mac/ComplexTextController.h: Renamed m_padding to m_expansion and m_padPerSpace
to m_expansionPerOpportunity.
* platform/graphics/mac/FontMac.mm:
(WebCore::Font::canExpandAroundIdeographsInComplexText): Added.
* platform/graphics/qt/FontQt.cpp:
(WebCore::Font::canExpandAroundIdeographsInComplexText): Added.
* platform/graphics/win/FontWin.cpp:
(WebCore::Font::canExpandAroundIdeographsInComplexText): Added.
* platform/graphics/win/UniscribeController.cpp:
(WebCore::UniscribeController::UniscribeController): Updated for rename.
* platform/graphics/wince/FontWinCE.cpp:
(WebCore::Font::canExpandAroundIdeographsInComplexText): Added.
* platform/graphics/wx/FontWx.cpp:
(WebCore::Font::canExpandAroundIdeographsInComplexText): Added.
* rendering/EllipsisBox.cpp:
(WebCore::EllipsisBox::paint): Pass a TrailingExpansionBehavior to the TextRun constructor.
(WebCore::EllipsisBox::selectionRect): Ditto.
(WebCore::EllipsisBox::paintSelection): Ditto.
* rendering/InlineBox.h:
(WebCore::InlineBox::InlineBox): Renamed m_toAdd to m_expansion.
(WebCore::InlineBox::expansion): Renamed toAdd() to this.
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::selectionRect): Pass a TrailingExpansionBehavior to the TextRun constructor.
(WebCore::InlineTextBox::paint): Ditto.
(WebCore::InlineTextBox::paintSelection): Ditto.
(WebCore::InlineTextBox::paintCompositionBackground): Ditto.
(WebCore::InlineTextBox::paintSpellingOrGrammarMarker): Ditto.
(WebCore::InlineTextBox::paintTextMatchMarker): Ditto.
(WebCore::InlineTextBox::computeRectForReplacementMarker): Ditto.
(WebCore::InlineTextBox::offsetForPosition): Ditto.
(WebCore::InlineTextBox::positionForOffset): Ditto.
* rendering/InlineTextBox.h:
(WebCore::InlineTextBox::setExpansion): Renamed setSpaceAdd() to this.
(WebCore::InlineTextBox::trailingExpansionBehavior): Added. Trailing expansion is allowed if this
is not the last leaf box on the line.
* rendering/RenderBlockLineLayout.cpp:
(WebCore::RenderBlock::computeInlineDirectionPositionsForLine): Keep expansion opportunity counts
in a vector instead of computing them twice. Discard the trailing expansion opportunity in the
last text box.
* rendering/RenderFileUploadControl.cpp:
(WebCore::RenderFileUploadControl::paintObject): Pass a TrailingExpansionBehavior to the TextRun constructor.
(WebCore::RenderFileUploadControl::computePreferredLogicalWidths): Ditto.
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::updateFromElement): Ditto.
(WebCore::RenderListBox::paintItemForeground): Ditto. Also corrected the type of the second parameter.
* rendering/RenderTextControl.cpp:
(WebCore::RenderTextControl::getAvgCharWidth): Ditto.
(WebCore::RenderTextControl::paintPlaceholder): Ditto.
* rendering/svg/SVGInlineTextBox.cpp:
(WebCore::SVGInlineTextBox::constructTextRun): Ditto.

Source/WebKit/chromium: 

* src/WebTextRun.cpp:
(WebKit::WebTextRun::operator WebCore::TextRun): Added a TrailingExpansionBehavior parameter to the
RenderText constructor.

Source/WebKit2: 

* WebProcess/WebCoreSupport/win/WebPopupMenuWin.cpp:
(WebKit::WebPopupMenu::setUpPlatformData): Added a TrailingExpansionBehavior parameter to the
RenderText constructor.

LayoutTests: 

* fast/text/justify-ideograph-complex.html: Added.
* fast/text/justify-ideograph-simple.html: Added.
* fast/text/justify-ideograph-vertical.html: Added.
* platform/mac/fast/text/justify-ideograph-complex-expected.checksum: Added.
* platform/mac/fast/text/justify-ideograph-complex-expected.png: Added.
* platform/mac/fast/text/justify-ideograph-complex-expected.txt: Added.
* platform/mac/fast/text/justify-ideograph-simple-expected.checksum: Added.
* platform/mac/fast/text/justify-ideograph-simple-expected.png: Added.
* platform/mac/fast/text/justify-ideograph-simple-expected.txt: Added.
* platform/mac/fast/text/justify-ideograph-vertical-expected.checksum: Added.
* platform/mac/fast/text/justify-ideograph-vertical-expected.png: Added.
* platform/mac/fast/text/justify-ideograph-vertical-expected.txt: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76743 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 2f912205
2011-01-26 Dan Bernstein <mitz@apple.com>
Reviewed by Dave Hyatt.
<rdar://problem/8446709> Allow inter-ideograph justification for CJK
https://bugs.webkit.org/show_bug.cgi?id=53184
* fast/text/justify-ideograph-complex.html: Added.
* fast/text/justify-ideograph-simple.html: Added.
* fast/text/justify-ideograph-vertical.html: Added.
* platform/mac/fast/text/justify-ideograph-complex-expected.checksum: Added.
* platform/mac/fast/text/justify-ideograph-complex-expected.png: Added.
* platform/mac/fast/text/justify-ideograph-complex-expected.txt: Added.
* platform/mac/fast/text/justify-ideograph-simple-expected.checksum: Added.
* platform/mac/fast/text/justify-ideograph-simple-expected.png: Added.
* platform/mac/fast/text/justify-ideograph-simple-expected.txt: Added.
* platform/mac/fast/text/justify-ideograph-vertical-expected.checksum: Added.
* platform/mac/fast/text/justify-ideograph-vertical-expected.png: Added.
* platform/mac/fast/text/justify-ideograph-vertical-expected.txt: Added.
2011-01-26 Martin Robinson <mrobinson@igalia.com>
Add the final set of CSS 2.1 GTK+ baselines.
<meta charset="utf-8">
<style>
p { width: 550px; text-align: justify; font-size: 12px; font-family: 'Lucida Grande'; text-rendering: optimizelegibility; }
</style>
<p>【2009 年 11 月 4 日美國加州 Cupertino 訊】蘋果今天宣佈,全世界最大的應用程式商店 App Store,目前已擁有 100,000 多種來自全球開發人員的應用程式。全世界 77 個國家的 iPhone® 與 iPod touch® 用戶擁有 20 個類別的應用程式可供選擇,包括:遊戲、商用、新聞、運動、醫療、參考書籍、旅遊等等。截至目前為止,App Store 使用者下載次數已超過 20 億次,是目前全球最受歡迎的應用程式商店。
<p>蘋果全球產品行銷資深副總裁 Philip Schiller 表示:「提供 100,000 多種應用程式可供選擇的 App Store,是全世界數千萬 iPhone 和 iPod touch 使用者令人稱羨的主要原因。iPhone SDK 創造了第一個優異的行動應用程式平台,客戶也非常喜愛開發人員所創作的應用程式。」</p>
<p>EA Mobile 的 Worldwide Studios 副總裁 Travis Boatman 指出:「App Store 不僅徹底改變了行動遊戲產業的生態,而且還在持續演進。有了全球 5 千多萬的 iPhone 和 iPod touch 客戶為基礎,App Store 讓我們能夠開發受到廣大的客戶喜愛的高品質 EA 遊戲。」</p>
<p>Smule 的執行長 Jeff Smith 表示:「我們的 I Am T-Pain 應用程式受到全球客戶的熱烈迴響,每日超過 10,000 次的下載遠遠超越我們的預期。App Store 給了我們一個獨特的商機,讓我們開創一個非常成功的事業,相信未來將更令人期待。」</p>
<p>蘋果也持續開發新的功能來提升搜尋與探索的便利性,包括:Genius for Apps、App Store Essentials、子分類清單,以及更豐富而寶貴的客戶評論。隨著新版的 iTunes® 9 推出,現在您可以輕輕鬆鬆直接在 iTunes 當中整理您的應用程式,一旦同步之後,iPhone 或 iPod touch 就會自動出現您所安排的配置。</p>
<p>今年夏天推出的 iPhone OS 3.0 為 iPhone 和 iPod touch 使用者提供了 100 多種全新的功能,包括:剪貼與拷貝;MMS;新增橫向檢視的 Mail、Text 和 Notes;立體聲 Bluetooth;搖一搖就隨機播放;電視節目分級保護控制;自動登入 Wi-Fi 熱點;以及 Push Notification 服務通知等等。這些新增功能受到客戶的廣大歡迎,截至目前為止,已經有超過 20 億次的 Push Notification 服務通知發送至 App Store 應用程式。此外,最近推出的應用程式內購買機制 (In-App Purchase),為領先的應用程式開發廠商提供了一種方式讓客戶直接從應用程式當中購買內容、訂閱項目及數位服務。</p>
<meta charset="utf-8">
<style>
p { width: 550px; text-align: justify; font-size: 12px; font-family: 'Lucida Grande'; }
</style>
<p>【2009 年 11 月 4 日美國加州 Cupertino 訊】蘋果今天宣佈,全世界最大的應用程式商店 App Store,目前已擁有 100,000 多種來自全球開發人員的應用程式。全世界 77 個國家的 iPhone® 與 iPod touch® 用戶擁有 20 個類別的應用程式可供選擇,包括:遊戲、商用、新聞、運動、醫療、參考書籍、旅遊等等。截至目前為止,App Store 使用者下載次數已超過 20 億次,是目前全球最受歡迎的應用程式商店。
<p>蘋果全球產品行銷資深副總裁 Philip Schiller 表示:「提供 100,000 多種應用程式可供選擇的 App Store,是全世界數千萬 iPhone 和 iPod touch 使用者令人稱羨的主要原因。iPhone SDK 創造了第一個優異的行動應用程式平台,客戶也非常喜愛開發人員所創作的應用程式。」</p>
<p>EA Mobile 的 Worldwide Studios 副總裁 Travis Boatman 指出:「App Store 不僅徹底改變了行動遊戲產業的生態,而且還在持續演進。有了全球 5 千多萬的 iPhone 和 iPod touch 客戶為基礎,App Store 讓我們能夠開發受到廣大的客戶喜愛的高品質 EA 遊戲。」</p>
<p>Smule 的執行長 Jeff Smith 表示:「我們的 I Am T-Pain 應用程式受到全球客戶的熱烈迴響,每日超過 10,000 次的下載遠遠超越我們的預期。App Store 給了我們一個獨特的商機,讓我們開創一個非常成功的事業,相信未來將更令人期待。」</p>
<p>蘋果也持續開發新的功能來提升搜尋與探索的便利性,包括:Genius for Apps、App Store Essentials、子分類清單,以及更豐富而寶貴的客戶評論。隨著新版的 iTunes® 9 推出,現在您可以輕輕鬆鬆直接在 iTunes 當中整理您的應用程式,一旦同步之後,iPhone 或 iPod touch 就會自動出現您所安排的配置。</p>
<p>今年夏天推出的 iPhone OS 3.0 為 iPhone 和 iPod touch 使用者提供了 100 多種全新的功能,包括:剪貼與拷貝;MMS;新增橫向檢視的 Mail、Text 和 Notes;立體聲 Bluetooth;搖一搖就隨機播放;電視節目分級保護控制;自動登入 Wi-Fi 熱點;以及 Push Notification 服務通知等等。這些新增功能受到客戶的廣大歡迎,截至目前為止,已經有超過 20 億次的 Push Notification 服務通知發送至 App Store 應用程式。此外,最近推出的應用程式內購買機制 (In-App Purchase),為領先的應用程式開發廠商提供了一種方式讓客戶直接從應用程式當中購買內容、訂閱項目及數位服務。</p>
<meta charset="utf-8">
<style>
p { height: 550px; text-align: justify; font-size: 12px; font-family: 'Lucida Grande'; }
</style>
<div style="-webkit-writing-mode: vertical-rl; height: 550px;">
<p>【2009 年 11 月 4 日美國加州 Cupertino 訊】蘋果今天宣佈,全世界最大的應用程式商店 App Store,目前已擁有 100,000 多種來自全球開發人員的應用程式。全世界 77 個國家的 iPhone® 與 iPod touch® 用戶擁有 20 個類別的應用程式可供選擇,包括:遊戲、商用、新聞、運動、醫療、參考書籍、旅遊等等。截至目前為止,App Store 使用者下載次數已超過 20 億次,是目前全球最受歡迎的應用程式商店。
<p>蘋果全球產品行銷資深副總裁 Philip Schiller 表示:「提供 100,000 多種應用程式可供選擇的 App Store,是全世界數千萬 iPhone 和 iPod touch 使用者令人稱羨的主要原因。iPhone SDK 創造了第一個優異的行動應用程式平台,客戶也非常喜愛開發人員所創作的應用程式。」</p>
<p>EA Mobile 的 Worldwide Studios 副總裁 Travis Boatman 指出:「App Store 不僅徹底改變了行動遊戲產業的生態,而且還在持續演進。有了全球 5 千多萬的 iPhone 和 iPod touch 客戶為基礎,App Store 讓我們能夠開發受到廣大的客戶喜愛的高品質 EA 遊戲。」</p>
<p>Smule 的執行長 Jeff Smith 表示:「我們的 I Am T-Pain 應用程式受到全球客戶的熱烈迴響,每日超過 10,000 次的下載遠遠超越我們的預期。App Store 給了我們一個獨特的商機,讓我們開創一個非常成功的事業,相信未來將更令人期待。」</p>
<p>蘋果也持續開發新的功能來提升搜尋與探索的便利性,包括:Genius for Apps、App Store Essentials、子分類清單,以及更豐富而寶貴的客戶評論。隨著新版的 iTunes® 9 推出,現在您可以輕輕鬆鬆直接在 iTunes 當中整理您的應用程式,一旦同步之後,iPhone 或 iPod touch 就會自動出現您所安排的配置。</p>
<p>今年夏天推出的 iPhone OS 3.0 為 iPhone 和 iPod touch 使用者提供了 100 多種全新的功能,包括:剪貼與拷貝;MMS;新增橫向檢視的 Mail、Text 和 Notes;立體聲 Bluetooth;搖一搖就隨機播放;電視節目分級保護控制;自動登入 Wi-Fi 熱點;以及 Push Notification 服務通知等等。這些新增功能受到客戶的廣大歡迎,截至目前為止,已經有超過 20 億次的 Push Notification 服務通知發送至 App Store 應用程式。此外,最近推出的應用程式內購買機制 (In-App Purchase),為領先的應用程式開發廠商提供了一種方式讓客戶直接從應用程式當中購買內容、訂閱項目及數位服務。</p>
</div>
0091eb5817d8785a9a9f3686f84932e6
\ No newline at end of file
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
layer at (0,0) size 800x600
RenderBlock {HTML} at (0,0) size 800x600
RenderBody {BODY} at (8,8) size 784x580
RenderBlock {P} at (0,0) size 550x90
RenderText {#text} at (0,1) size 550x87
text run at (0,1) width 550: "\x{3010}2009 \x{5E74} 11 \x{6708} 4 \x{65E5}\x{7F8E}\x{570B}\x{52A0}\x{5DDE} Cupertino \x{8A0A}\x{3011}\x{860B}\x{679C}\x{4ECA}\x{5929}\x{5BA3}\x{4F48}\x{FF0C}\x{5168}\x{4E16}\x{754C}\x{6700}\x{5927}\x{7684}\x{61C9}\x{7528}\x{7A0B}\x{5F0F}\x{5546}\x{5E97} App"
text run at (0,19) width 550: "Store\x{FF0C}\x{76EE}\x{524D}\x{5DF2}\x{64C1}\x{6709} 100,000 \x{591A}\x{7A2E}\x{4F86}\x{81EA}\x{5168}\x{7403}\x{958B}\x{767C}\x{4EBA}\x{54E1}\x{7684}\x{61C9}\x{7528}\x{7A0B}\x{5F0F}\x{3002}\x{5168}\x{4E16}\x{754C} 77 \x{500B}\x{570B}\x{5BB6}\x{7684} iPhone\x{AE} \x{8207}"
text run at (0,37) width 550: "iPod touch\x{AE} \x{7528}\x{6236}\x{64C1}\x{6709} 20 \x{500B}\x{985E}\x{5225}\x{7684}\x{61C9}\x{7528}\x{7A0B}\x{5F0F}\x{53EF}\x{4F9B}\x{9078}\x{64C7}\x{FF0C}\x{5305}\x{62EC}\x{FF1A}\x{904A}\x{6232}\x{3001}\x{5546}\x{7528}\x{3001}\x{65B0}\x{805E}\x{3001}\x{904B}\x{52D5}\x{3001}\x{91AB}\x{7642}\x{3001}\x{53C3}\x{8003}"
text run at (0,55) width 550: "\x{66F8}\x{7C4D}\x{3001}\x{65C5}\x{904A}\x{7B49}\x{7B49}\x{3002}\x{622A}\x{81F3}\x{76EE}\x{524D}\x{70BA}\x{6B62}\x{FF0C}App Store \x{4F7F}\x{7528}\x{8005}\x{4E0B}\x{8F09}\x{6B21}\x{6578}\x{5DF2}\x{8D85}\x{904E} 20 \x{5104}\x{6B21}\x{FF0C}\x{662F}\x{76EE}\x{524D}\x{5168}\x{7403}\x{6700}\x{53D7}\x{6B61}\x{8FCE}\x{7684}"
text run at (0,73) width 84: "\x{61C9}\x{7528}\x{7A0B}\x{5F0F}\x{5546}\x{5E97}\x{3002}"
RenderBlock {P} at (0,102) size 550x54
RenderText {#text} at (0,1) size 550x51
text run at (0,1) width 550: "\x{860B}\x{679C}\x{5168}\x{7403}\x{7522}\x{54C1}\x{884C}\x{92B7}\x{8CC7}\x{6DF1}\x{526F}\x{7E3D}\x{88C1} Philip Schiller \x{8868}\x{793A}\x{FF1A}\x{300C}\x{63D0}\x{4F9B} 100,000 \x{591A}\x{7A2E}\x{61C9}\x{7528}\x{7A0B}\x{5F0F}\x{53EF}\x{4F9B}\x{9078}\x{64C7}\x{7684} App"
text run at (0,19) width 550: "Store\x{FF0C}\x{662F}\x{5168}\x{4E16}\x{754C}\x{6578}\x{5343}\x{842C} iPhone \x{548C} iPod touch \x{4F7F}\x{7528}\x{8005}\x{4EE4}\x{4EBA}\x{7A31}\x{7FA8}\x{7684}\x{4E3B}\x{8981}\x{539F}\x{56E0}\x{3002}iPhone SDK \x{5275}\x{9020}\x{4E86}\x{7B2C}\x{4E00}"
text run at (0,37) width 408: "\x{500B}\x{512A}\x{7570}\x{7684}\x{884C}\x{52D5}\x{61C9}\x{7528}\x{7A0B}\x{5F0F}\x{5E73}\x{53F0}\x{FF0C}\x{5BA2}\x{6236}\x{4E5F}\x{975E}\x{5E38}\x{559C}\x{611B}\x{958B}\x{767C}\x{4EBA}\x{54E1}\x{6240}\x{5275}\x{4F5C}\x{7684}\x{61C9}\x{7528}\x{7A0B}\x{5F0F}\x{3002}\x{300D}"
RenderBlock {P} at (0,168) size 550x54
RenderText {#text} at (0,1) size 550x51
text run at (0,1) width 550: "EA Mobile \x{7684} Worldwide Studios \x{526F}\x{7E3D}\x{88C1} Travis Boatman \x{6307}\x{51FA}\x{FF1A}\x{300C}App Store \x{4E0D}\x{50C5}\x{5FB9}\x{5E95}\x{6539}\x{8B8A}\x{4E86}\x{884C}\x{52D5}"
text run at (0,19) width 550: "\x{904A}\x{6232}\x{7522}\x{696D}\x{7684}\x{751F}\x{614B}\x{FF0C}\x{800C}\x{4E14}\x{9084}\x{5728}\x{6301}\x{7E8C}\x{6F14}\x{9032}\x{3002}\x{6709}\x{4E86}\x{5168}\x{7403} 5 \x{5343}\x{591A}\x{842C}\x{7684} iPhone \x{548C} iPod touch \x{5BA2}\x{6236}\x{70BA}\x{57FA}\x{790E}\x{FF0C}App"
text run at (0,37) width 345: "Store \x{8B93}\x{6211}\x{5011}\x{80FD}\x{5920}\x{958B}\x{767C}\x{53D7}\x{5230}\x{5EE3}\x{5927}\x{7684}\x{5BA2}\x{6236}\x{559C}\x{611B}\x{7684}\x{9AD8}\x{54C1}\x{8CEA} EA \x{904A}\x{6232}\x{3002}\x{300D}"
RenderBlock {P} at (0,234) size 550x54
RenderText {#text} at (0,1) size 550x51
text run at (0,1) width 550: "Smule \x{7684}\x{57F7}\x{884C}\x{9577} Jeff Smith \x{8868}\x{793A}\x{FF1A}\x{300C}\x{6211}\x{5011}\x{7684} I Am T-Pain \x{61C9}\x{7528}\x{7A0B}\x{5F0F}\x{53D7}\x{5230}\x{5168}\x{7403}\x{5BA2}\x{6236}\x{7684}\x{71B1}\x{70C8}\x{8FF4}\x{97FF}\x{FF0C}\x{6BCF}\x{65E5}\x{8D85}"
text run at (0,19) width 550: "\x{904E} 10,000 \x{6B21}\x{7684}\x{4E0B}\x{8F09}\x{9060}\x{9060}\x{8D85}\x{8D8A}\x{6211}\x{5011}\x{7684}\x{9810}\x{671F}\x{3002}App Store \x{7D66}\x{4E86}\x{6211}\x{5011}\x{4E00}\x{500B}\x{7368}\x{7279}\x{7684}\x{5546}\x{6A5F}\x{FF0C}\x{8B93}\x{6211}\x{5011}\x{958B}\x{5275}\x{4E00}\x{500B}\x{975E}\x{5E38}"
text run at (0,37) width 216: "\x{6210}\x{529F}\x{7684}\x{4E8B}\x{696D}\x{FF0C}\x{76F8}\x{4FE1}\x{672A}\x{4F86}\x{5C07}\x{66F4}\x{4EE4}\x{4EBA}\x{671F}\x{5F85}\x{3002}\x{300D}"
RenderBlock {P} at (0,300) size 550x72
RenderText {#text} at (0,1) size 550x69
text run at (0,1) width 550: "\x{860B}\x{679C}\x{4E5F}\x{6301}\x{7E8C}\x{958B}\x{767C}\x{65B0}\x{7684}\x{529F}\x{80FD}\x{4F86}\x{63D0}\x{5347}\x{641C}\x{5C0B}\x{8207}\x{63A2}\x{7D22}\x{7684}\x{4FBF}\x{5229}\x{6027}\x{FF0C}\x{5305}\x{62EC}\x{FF1A}Genius for Apps\x{3001}App Store"
text run at (0,19) width 550: "Essentials\x{3001}\x{5B50}\x{5206}\x{985E}\x{6E05}\x{55AE}\x{FF0C}\x{4EE5}\x{53CA}\x{66F4}\x{8C50}\x{5BCC}\x{800C}\x{5BF6}\x{8CB4}\x{7684}\x{5BA2}\x{6236}\x{8A55}\x{8AD6}\x{3002}\x{96A8}\x{8457}\x{65B0}\x{7248}\x{7684} iTunes\x{AE} 9 \x{63A8}\x{51FA}\x{FF0C}\x{73FE}\x{5728}\x{60A8}\x{53EF}\x{4EE5}\x{8F15}"
text run at (0,37) width 550: "\x{8F15}\x{9B06}\x{9B06}\x{76F4}\x{63A5}\x{5728} iTunes \x{7576}\x{4E2D}\x{6574}\x{7406}\x{60A8}\x{7684}\x{61C9}\x{7528}\x{7A0B}\x{5F0F}\x{FF0C}\x{4E00}\x{65E6}\x{540C}\x{6B65}\x{4E4B}\x{5F8C}\x{FF0C}iPhone \x{6216} iPod touch \x{5C31}\x{6703}\x{81EA}\x{52D5}\x{51FA}\x{73FE}\x{60A8}"
text run at (0,55) width 84: "\x{6240}\x{5B89}\x{6392}\x{7684}\x{914D}\x{7F6E}\x{3002}"
RenderBlock {P} at (0,384) size 550x108
RenderText {#text} at (0,1) size 550x105
text run at (0,1) width 550: "\x{4ECA}\x{5E74}\x{590F}\x{5929}\x{63A8}\x{51FA}\x{7684} iPhone OS 3.0 \x{70BA} iPhone \x{548C} iPod touch \x{4F7F}\x{7528}\x{8005}\x{63D0}\x{4F9B}\x{4E86} 100 \x{591A}\x{7A2E}\x{5168}\x{65B0}\x{7684}\x{529F}\x{80FD}\x{FF0C}\x{5305}"
text run at (0,19) width 550: "\x{62EC}\x{FF1A}\x{526A}\x{8CBC}\x{8207}\x{62F7}\x{8C9D}\x{FF1B}MMS\x{FF1B}\x{65B0}\x{589E}\x{6A6B}\x{5411}\x{6AA2}\x{8996}\x{7684} Mail\x{3001}Text \x{548C} Notes\x{FF1B}\x{7ACB}\x{9AD4}\x{8072} Bluetooth\x{FF1B}\x{6416}\x{4E00}\x{6416}\x{5C31}\x{96A8}\x{6A5F}\x{64AD}"
text run at (0,37) width 550: "\x{653E}\x{FF1B}\x{96FB}\x{8996}\x{7BC0}\x{76EE}\x{5206}\x{7D1A}\x{4FDD}\x{8B77}\x{63A7}\x{5236}\x{FF1B}\x{81EA}\x{52D5}\x{767B}\x{5165} Wi-Fi \x{71B1}\x{9EDE}\x{FF1B}\x{4EE5}\x{53CA} Push Notification \x{670D}\x{52D9}\x{901A}\x{77E5}\x{7B49}\x{7B49}\x{3002}\x{9019}\x{4E9B}\x{65B0}\x{589E}"
text run at (0,55) width 550: "\x{529F}\x{80FD}\x{53D7}\x{5230}\x{5BA2}\x{6236}\x{7684}\x{5EE3}\x{5927}\x{6B61}\x{8FCE}\x{FF0C}\x{622A}\x{81F3}\x{76EE}\x{524D}\x{70BA}\x{6B62}\x{FF0C}\x{5DF2}\x{7D93}\x{6709}\x{8D85}\x{904E} 20 \x{5104}\x{6B21}\x{7684} Push Notification \x{670D}\x{52D9}\x{901A}\x{77E5}\x{767C}\x{9001}\x{81F3}"
text run at (0,73) width 550: "App Store \x{61C9}\x{7528}\x{7A0B}\x{5F0F}\x{3002}\x{6B64}\x{5916}\x{FF0C}\x{6700}\x{8FD1}\x{63A8}\x{51FA}\x{7684}\x{61C9}\x{7528}\x{7A0B}\x{5F0F}\x{5167}\x{8CFC}\x{8CB7}\x{6A5F}\x{5236} (In-App Purchase)\x{FF0C}\x{70BA}\x{9818}\x{5148}\x{7684}\x{61C9}\x{7528}\x{7A0B}\x{5F0F}"
text run at (0,91) width 456: "\x{958B}\x{767C}\x{5EE0}\x{5546}\x{63D0}\x{4F9B}\x{4E86}\x{4E00}\x{7A2E}\x{65B9}\x{5F0F}\x{8B93}\x{5BA2}\x{6236}\x{76F4}\x{63A5}\x{5F9E}\x{61C9}\x{7528}\x{7A0B}\x{5F0F}\x{7576}\x{4E2D}\x{8CFC}\x{8CB7}\x{5167}\x{5BB9}\x{3001}\x{8A02}\x{95B1}\x{9805}\x{76EE}\x{53CA}\x{6578}\x{4F4D}\x{670D}\x{52D9}\x{3002}"
8494b6ff162ad9c96022a5f8fe2dc0d3
\ No newline at end of file
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
layer at (0,0) size 800x600
RenderBlock {HTML} at (0,0) size 800x600
RenderBody {BODY} at (8,8) size 784x580
RenderBlock {P} at (0,0) size 550x90
RenderText {#text} at (0,1) size 550x87
text run at (0,1) width 550: "\x{3010}2009 \x{5E74} 11 \x{6708} 4 \x{65E5}\x{7F8E}\x{570B}\x{52A0}\x{5DDE} Cupertino \x{8A0A}\x{3011}\x{860B}\x{679C}\x{4ECA}\x{5929}\x{5BA3}\x{4F48}\x{FF0C}\x{5168}\x{4E16}\x{754C}\x{6700}\x{5927}\x{7684}\x{61C9}\x{7528}\x{7A0B}\x{5F0F}\x{5546}\x{5E97} App"
text run at (0,19) width 550: "Store\x{FF0C}\x{76EE}\x{524D}\x{5DF2}\x{64C1}\x{6709} 100,000 \x{591A}\x{7A2E}\x{4F86}\x{81EA}\x{5168}\x{7403}\x{958B}\x{767C}\x{4EBA}\x{54E1}\x{7684}\x{61C9}\x{7528}\x{7A0B}\x{5F0F}\x{3002}\x{5168}\x{4E16}\x{754C} 77 \x{500B}\x{570B}\x{5BB6}\x{7684} iPhone\x{AE} \x{8207}"
text run at (0,37) width 550: "iPod touch\x{AE} \x{7528}\x{6236}\x{64C1}\x{6709} 20 \x{500B}\x{985E}\x{5225}\x{7684}\x{61C9}\x{7528}\x{7A0B}\x{5F0F}\x{53EF}\x{4F9B}\x{9078}\x{64C7}\x{FF0C}\x{5305}\x{62EC}\x{FF1A}\x{904A}\x{6232}\x{3001}\x{5546}\x{7528}\x{3001}\x{65B0}\x{805E}\x{3001}\x{904B}\x{52D5}\x{3001}\x{91AB}\x{7642}\x{3001}\x{53C3}\x{8003}"
text run at (0,55) width 550: "\x{66F8}\x{7C4D}\x{3001}\x{65C5}\x{904A}\x{7B49}\x{7B49}\x{3002}\x{622A}\x{81F3}\x{76EE}\x{524D}\x{70BA}\x{6B62}\x{FF0C}App Store \x{4F7F}\x{7528}\x{8005}\x{4E0B}\x{8F09}\x{6B21}\x{6578}\x{5DF2}\x{8D85}\x{904E} 20 \x{5104}\x{6B21}\x{FF0C}\x{662F}\x{76EE}\x{524D}\x{5168}\x{7403}\x{6700}\x{53D7}\x{6B61}\x{8FCE}\x{7684}"
text run at (0,73) width 84: "\x{61C9}\x{7528}\x{7A0B}\x{5F0F}\x{5546}\x{5E97}\x{3002}"
RenderBlock {P} at (0,102) size 550x54
RenderText {#text} at (0,1) size 550x51
text run at (0,1) width 550: "\x{860B}\x{679C}\x{5168}\x{7403}\x{7522}\x{54C1}\x{884C}\x{92B7}\x{8CC7}\x{6DF1}\x{526F}\x{7E3D}\x{88C1} Philip Schiller \x{8868}\x{793A}\x{FF1A}\x{300C}\x{63D0}\x{4F9B} 100,000 \x{591A}\x{7A2E}\x{61C9}\x{7528}\x{7A0B}\x{5F0F}\x{53EF}\x{4F9B}\x{9078}\x{64C7}\x{7684} App"
text run at (0,19) width 550: "Store\x{FF0C}\x{662F}\x{5168}\x{4E16}\x{754C}\x{6578}\x{5343}\x{842C} iPhone \x{548C} iPod touch \x{4F7F}\x{7528}\x{8005}\x{4EE4}\x{4EBA}\x{7A31}\x{7FA8}\x{7684}\x{4E3B}\x{8981}\x{539F}\x{56E0}\x{3002}iPhone SDK \x{5275}\x{9020}\x{4E86}\x{7B2C}\x{4E00}"
text run at (0,37) width 408: "\x{500B}\x{512A}\x{7570}\x{7684}\x{884C}\x{52D5}\x{61C9}\x{7528}\x{7A0B}\x{5F0F}\x{5E73}\x{53F0}\x{FF0C}\x{5BA2}\x{6236}\x{4E5F}\x{975E}\x{5E38}\x{559C}\x{611B}\x{958B}\x{767C}\x{4EBA}\x{54E1}\x{6240}\x{5275}\x{4F5C}\x{7684}\x{61C9}\x{7528}\x{7A0B}\x{5F0F}\x{3002}\x{300D}"
RenderBlock {P} at (0,168) size 550x54
RenderText {#text} at (0,1) size 550x51
text run at (0,1) width 550: "EA Mobile \x{7684} Worldwide Studios \x{526F}\x{7E3D}\x{88C1} Travis Boatman \x{6307}\x{51FA}\x{FF1A}\x{300C}App Store \x{4E0D}\x{50C5}\x{5FB9}\x{5E95}\x{6539}\x{8B8A}\x{4E86}\x{884C}\x{52D5}"
text run at (0,19) width 550: "\x{904A}\x{6232}\x{7522}\x{696D}\x{7684}\x{751F}\x{614B}\x{FF0C}\x{800C}\x{4E14}\x{9084}\x{5728}\x{6301}\x{7E8C}\x{6F14}\x{9032}\x{3002}\x{6709}\x{4E86}\x{5168}\x{7403} 5 \x{5343}\x{591A}\x{842C}\x{7684} iPhone \x{548C} iPod touch \x{5BA2}\x{6236}\x{70BA}\x{57FA}\x{790E}\x{FF0C}App"
text run at (0,37) width 345: "Store \x{8B93}\x{6211}\x{5011}\x{80FD}\x{5920}\x{958B}\x{767C}\x{53D7}\x{5230}\x{5EE3}\x{5927}\x{7684}\x{5BA2}\x{6236}\x{559C}\x{611B}\x{7684}\x{9AD8}\x{54C1}\x{8CEA} EA \x{904A}\x{6232}\x{3002}\x{300D}"
RenderBlock {P} at (0,234) size 550x54
RenderText {#text} at (0,1) size 550x51
text run at (0,1) width 550: "Smule \x{7684}\x{57F7}\x{884C}\x{9577} Jeff Smith \x{8868}\x{793A}\x{FF1A}\x{300C}\x{6211}\x{5011}\x{7684} I Am T-Pain \x{61C9}\x{7528}\x{7A0B}\x{5F0F}\x{53D7}\x{5230}\x{5168}\x{7403}\x{5BA2}\x{6236}\x{7684}\x{71B1}\x{70C8}\x{8FF4}\x{97FF}\x{FF0C}\x{6BCF}\x{65E5}\x{8D85}"
text run at (0,19) width 550: "\x{904E} 10,000 \x{6B21}\x{7684}\x{4E0B}\x{8F09}\x{9060}\x{9060}\x{8D85}\x{8D8A}\x{6211}\x{5011}\x{7684}\x{9810}\x{671F}\x{3002}App Store \x{7D66}\x{4E86}\x{6211}\x{5011}\x{4E00}\x{500B}\x{7368}\x{7279}\x{7684}\x{5546}\x{6A5F}\x{FF0C}\x{8B93}\x{6211}\x{5011}\x{958B}\x{5275}\x{4E00}\x{500B}\x{975E}\x{5E38}"
text run at (0,37) width 216: "\x{6210}\x{529F}\x{7684}\x{4E8B}\x{696D}\x{FF0C}\x{76F8}\x{4FE1}\x{672A}\x{4F86}\x{5C07}\x{66F4}\x{4EE4}\x{4EBA}\x{671F}\x{5F85}\x{3002}\x{300D}"
RenderBlock {P} at (0,300) size 550x72
RenderText {#text} at (0,1) size 550x69
text run at (0,1) width 550: "\x{860B}\x{679C}\x{4E5F}\x{6301}\x{7E8C}\x{958B}\x{767C}\x{65B0}\x{7684}\x{529F}\x{80FD}\x{4F86}\x{63D0}\x{5347}\x{641C}\x{5C0B}\x{8207}\x{63A2}\x{7D22}\x{7684}\x{4FBF}\x{5229}\x{6027}\x{FF0C}\x{5305}\x{62EC}\x{FF1A}Genius for Apps\x{3001}App Store"
text run at (0,19) width 550: "Essentials\x{3001}\x{5B50}\x{5206}\x{985E}\x{6E05}\x{55AE}\x{FF0C}\x{4EE5}\x{53CA}\x{66F4}\x{8C50}\x{5BCC}\x{800C}\x{5BF6}\x{8CB4}\x{7684}\x{5BA2}\x{6236}\x{8A55}\x{8AD6}\x{3002}\x{96A8}\x{8457}\x{65B0}\x{7248}\x{7684} iTunes\x{AE} 9 \x{63A8}\x{51FA}\x{FF0C}\x{73FE}\x{5728}\x{60A8}\x{53EF}\x{4EE5}\x{8F15}"
text run at (0,37) width 550: "\x{8F15}\x{9B06}\x{9B06}\x{76F4}\x{63A5}\x{5728} iTunes \x{7576}\x{4E2D}\x{6574}\x{7406}\x{60A8}\x{7684}\x{61C9}\x{7528}\x{7A0B}\x{5F0F}\x{FF0C}\x{4E00}\x{65E6}\x{540C}\x{6B65}\x{4E4B}\x{5F8C}\x{FF0C}iPhone \x{6216} iPod touch \x{5C31}\x{6703}\x{81EA}\x{52D5}\x{51FA}\x{73FE}\x{60A8}"
text run at (0,55) width 84: "\x{6240}\x{5B89}\x{6392}\x{7684}\x{914D}\x{7F6E}\x{3002}"
RenderBlock {P} at (0,384) size 550x108
RenderText {#text} at (0,1) size 550x105
text run at (0,1) width 550: "\x{4ECA}\x{5E74}\x{590F}\x{5929}\x{63A8}\x{51FA}\x{7684} iPhone OS 3.0 \x{70BA} iPhone \x{548C} iPod touch \x{4F7F}\x{7528}\x{8005}\x{63D0}\x{4F9B}\x{4E86} 100 \x{591A}\x{7A2E}\x{5168}\x{65B0}\x{7684}\x{529F}\x{80FD}\x{FF0C}\x{5305}"
text run at (0,19) width 550: "\x{62EC}\x{FF1A}\x{526A}\x{8CBC}\x{8207}\x{62F7}\x{8C9D}\x{FF1B}MMS\x{FF1B}\x{65B0}\x{589E}\x{6A6B}\x{5411}\x{6AA2}\x{8996}\x{7684} Mail\x{3001}Text \x{548C} Notes\x{FF1B}\x{7ACB}\x{9AD4}\x{8072} Bluetooth\x{FF1B}\x{6416}\x{4E00}\x{6416}\x{5C31}\x{96A8}\x{6A5F}\x{64AD}"
text run at (0,37) width 550: "\x{653E}\x{FF1B}\x{96FB}\x{8996}\x{7BC0}\x{76EE}\x{5206}\x{7D1A}\x{4FDD}\x{8B77}\x{63A7}\x{5236}\x{FF1B}\x{81EA}\x{52D5}\x{767B}\x{5165} Wi-Fi \x{71B1}\x{9EDE}\x{FF1B}\x{4EE5}\x{53CA} Push Notification \x{670D}\x{52D9}\x{901A}\x{77E5}\x{7B49}\x{7B49}\x{3002}\x{9019}\x{4E9B}\x{65B0}\x{589E}"
text run at (0,55) width 550: "\x{529F}\x{80FD}\x{53D7}\x{5230}\x{5BA2}\x{6236}\x{7684}\x{5EE3}\x{5927}\x{6B61}\x{8FCE}\x{FF0C}\x{622A}\x{81F3}\x{76EE}\x{524D}\x{70BA}\x{6B62}\x{FF0C}\x{5DF2}\x{7D93}\x{6709}\x{8D85}\x{904E} 20 \x{5104}\x{6B21}\x{7684} Push Notification \x{670D}\x{52D9}\x{901A}\x{77E5}\x{767C}\x{9001}\x{81F3}"
text run at (0,73) width 550: "App Store \x{61C9}\x{7528}\x{7A0B}\x{5F0F}\x{3002}\x{6B64}\x{5916}\x{FF0C}\x{6700}\x{8FD1}\x{63A8}\x{51FA}\x{7684}\x{61C9}\x{7528}\x{7A0B}\x{5F0F}\x{5167}\x{8CFC}\x{8CB7}\x{6A5F}\x{5236} (In-App Purchase)\x{FF0C}\x{70BA}\x{9818}\x{5148}\x{7684}\x{61C9}\x{7528}\x{7A0B}\x{5F0F}"
text run at (0,91) width 456: "\x{958B}\x{767C}\x{5EE0}\x{5546}\x{63D0}\x{4F9B}\x{4E86}\x{4E00}\x{7A2E}\x{65B9}\x{5F0F}\x{8B93}\x{5BA2}\x{6236}\x{76F4}\x{63A5}\x{5F9E}\x{61C9}\x{7528}\x{7A0B}\x{5F0F}\x{7576}\x{4E2D}\x{8CFC}\x{8CB7}\x{5167}\x{5BB9}\x{3001}\x{8A02}\x{95B1}\x{9805}\x{76EE}\x{53CA}\x{6578}\x{4F4D}\x{670D}\x{52D9}\x{3002}"
6d792716aa1326d1482fd6c3aea0ea2d
\ No newline at end of file
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
layer at (0,0) size 800x600
RenderBlock {HTML} at (0,0) size 800x600
RenderBody {BODY} at (8,8) size 784x584
RenderBlock {DIV} at (0,0) size 450x550
RenderBlock {P} at (0,12) size 90x550
RenderText {#text} at (1,0) size 87x550
text run at (1,0) width 550: "\x{3010}2009 \x{5E74} 11 \x{6708} 4 \x{65E5}\x{7F8E}\x{570B}\x{52A0}\x{5DDE} Cupertino \x{8A0A}\x{3011}\x{860B}\x{679C}\x{4ECA}\x{5929}\x{5BA3}\x{4F48}\x{FF0C}\x{5168}\x{4E16}\x{754C}\x{6700}\x{5927}\x{7684}\x{61C9}\x{7528}\x{7A0B}\x{5F0F}\x{5546}\x{5E97} App"
text run at (19,0) width 550: "Store\x{FF0C}\x{76EE}\x{524D}\x{5DF2}\x{64C1}\x{6709} 100,000 \x{591A}\x{7A2E}\x{4F86}\x{81EA}\x{5168}\x{7403}\x{958B}\x{767C}\x{4EBA}\x{54E1}\x{7684}\x{61C9}\x{7528}\x{7A0B}\x{5F0F}\x{3002}\x{5168}\x{4E16}\x{754C} 77 \x{500B}\x{570B}\x{5BB6}\x{7684} iPhone\x{AE}"
text run at (37,0) width 550: "\x{8207} iPod touch\x{AE} \x{7528}\x{6236}\x{64C1}\x{6709} 20 \x{500B}\x{985E}\x{5225}\x{7684}\x{61C9}\x{7528}\x{7A0B}\x{5F0F}\x{53EF}\x{4F9B}\x{9078}\x{64C7}\x{FF0C}\x{5305}\x{62EC}\x{FF1A}\x{904A}\x{6232}\x{3001}\x{5546}\x{7528}\x{3001}\x{65B0}\x{805E}\x{3001}\x{904B}\x{52D5}\x{3001}\x{91AB}"
text run at (55,0) width 550: "\x{7642}\x{3001}\x{53C3}\x{8003}\x{66F8}\x{7C4D}\x{3001}\x{65C5}\x{904A}\x{7B49}\x{7B49}\x{3002}\x{622A}\x{81F3}\x{76EE}\x{524D}\x{70BA}\x{6B62}\x{FF0C}App Store \x{4F7F}\x{7528}\x{8005}\x{4E0B}\x{8F09}\x{6B21}\x{6578}\x{5DF2}\x{8D85}\x{904E} 20 \x{5104}\x{6B21}\x{FF0C}\x{662F}\x{76EE}\x{524D}\x{5168}"
text run at (73,0) width 158: "\x{7403}\x{6700}\x{53D7}\x{6B61}\x{8FCE}\x{7684}\x{61C9}\x{7528}\x{7A0B}\x{5F0F}\x{5546}\x{5E97}\x{3002}"
RenderBlock {P} at (90,12) size 54x550
RenderText {#text} at (1,0) size 51x550
text run at (1,0) width 550: "\x{860B}\x{679C}\x{5168}\x{7403}\x{7522}\x{54C1}\x{884C}\x{92B7}\x{8CC7}\x{6DF1}\x{526F}\x{7E3D}\x{88C1} Philip Schiller \x{8868}\x{793A}\x{FF1A}\x{300C}\x{63D0}\x{4F9B} 100,000 \x{591A}\x{7A2E}\x{61C9}\x{7528}\x{7A0B}\x{5F0F}\x{53EF}\x{4F9B}\x{9078}\x{64C7}\x{7684}"
text run at (19,0) width 550: "App Store\x{FF0C}\x{662F}\x{5168}\x{4E16}\x{754C}\x{6578}\x{5343}\x{842C} iPhone \x{548C} iPod touch \x{4F7F}\x{7528}\x{8005}\x{4EE4}\x{4EBA}\x{7A31}\x{7FA8}\x{7684}\x{4E3B}\x{8981}\x{539F}\x{56E0}\x{3002}iPhone SDK \x{5275}"
text run at (37,0) width 460: "\x{9020}\x{4E86}\x{7B2C}\x{4E00}\x{500B}\x{512A}\x{7570}\x{7684}\x{884C}\x{52D5}\x{61C9}\x{7528}\x{7A0B}\x{5F0F}\x{5E73}\x{53F0}\x{FF0C}\x{5BA2}\x{6236}\x{4E5F}\x{975E}\x{5E38}\x{559C}\x{611B}\x{958B}\x{767C}\x{4EBA}\x{54E1}\x{6240}\x{5275}\x{4F5C}\x{7684}\x{61C9}\x{7528}\x{7A0B}\x{5F0F}\x{3002}\x{300D}"
RenderBlock {P} at (144,12) size 54x550
RenderText {#text} at (1,0) size 51x550
text run at (1,0) width 550: "EA Mobile \x{7684} Worldwide Studios \x{526F}\x{7E3D}\x{88C1} Travis Boatman \x{6307}\x{51FA}\x{FF1A}\x{300C}App Store \x{4E0D}\x{50C5}\x{5FB9}\x{5E95}\x{6539}\x{8B8A}\x{4E86}\x{884C}"
text run at (19,0) width 550: "\x{52D5}\x{904A}\x{6232}\x{7522}\x{696D}\x{7684}\x{751F}\x{614B}\x{FF0C}\x{800C}\x{4E14}\x{9084}\x{5728}\x{6301}\x{7E8C}\x{6F14}\x{9032}\x{3002}\x{6709}\x{4E86}\x{5168}\x{7403} 5 \x{5343}\x{591A}\x{842C}\x{7684} iPhone \x{548C} iPod touch \x{5BA2}\x{6236}\x{70BA}\x{57FA}"
text run at (37,0) width 400: "\x{790E}\x{FF0C}App Store \x{8B93}\x{6211}\x{5011}\x{80FD}\x{5920}\x{958B}\x{767C}\x{53D7}\x{5230}\x{5EE3}\x{5927}\x{7684}\x{5BA2}\x{6236}\x{559C}\x{611B}\x{7684}\x{9AD8}\x{54C1}\x{8CEA} EA \x{904A}\x{6232}\x{3002}\x{300D}"
RenderBlock {P} at (198,12) size 54x550
RenderText {#text} at (1,0) size 51x550
text run at (1,0) width 550: "Smule \x{7684}\x{57F7}\x{884C}\x{9577} Jeff Smith \x{8868}\x{793A}\x{FF1A}\x{300C}\x{6211}\x{5011}\x{7684} I Am T-Pain \x{61C9}\x{7528}\x{7A0B}\x{5F0F}\x{53D7}\x{5230}\x{5168}\x{7403}\x{5BA2}\x{6236}\x{7684}\x{71B1}\x{70C8}\x{8FF4}\x{97FF}\x{FF0C}\x{6BCF}"
text run at (19,0) width 550: "\x{65E5}\x{8D85}\x{904E} 10,000 \x{6B21}\x{7684}\x{4E0B}\x{8F09}\x{9060}\x{9060}\x{8D85}\x{8D8A}\x{6211}\x{5011}\x{7684}\x{9810}\x{671F}\x{3002}App Store \x{7D66}\x{4E86}\x{6211}\x{5011}\x{4E00}\x{500B}\x{7368}\x{7279}\x{7684}\x{5546}\x{6A5F}\x{FF0C}\x{8B93}\x{6211}\x{5011}\x{958B}"
text run at (37,0) width 278: "\x{5275}\x{4E00}\x{500B}\x{975E}\x{5E38}\x{6210}\x{529F}\x{7684}\x{4E8B}\x{696D}\x{FF0C}\x{76F8}\x{4FE1}\x{672A}\x{4F86}\x{5C07}\x{66F4}\x{4EE4}\x{4EBA}\x{671F}\x{5F85}\x{3002}\x{300D}"
RenderBlock {P} at (252,12) size 72x550
RenderText {#text} at (1,0) size 69x550
text run at (1,0) width 550: "\x{860B}\x{679C}\x{4E5F}\x{6301}\x{7E8C}\x{958B}\x{767C}\x{65B0}\x{7684}\x{529F}\x{80FD}\x{4F86}\x{63D0}\x{5347}\x{641C}\x{5C0B}\x{8207}\x{63A2}\x{7D22}\x{7684}\x{4FBF}\x{5229}\x{6027}\x{FF0C}\x{5305}\x{62EC}\x{FF1A}Genius for Apps\x{3001}App Store"
text run at (19,0) width 550: "Essentials\x{3001}\x{5B50}\x{5206}\x{985E}\x{6E05}\x{55AE}\x{FF0C}\x{4EE5}\x{53CA}\x{66F4}\x{8C50}\x{5BCC}\x{800C}\x{5BF6}\x{8CB4}\x{7684}\x{5BA2}\x{6236}\x{8A55}\x{8AD6}\x{3002}\x{96A8}\x{8457}\x{65B0}\x{7248}\x{7684} iTunes\x{AE} 9 \x{63A8}\x{51FA}\x{FF0C}\x{73FE}\x{5728}\x{60A8}"
text run at (37,0) width 550: "\x{53EF}\x{4EE5}\x{8F15}\x{8F15}\x{9B06}\x{9B06}\x{76F4}\x{63A5}\x{5728} iTunes \x{7576}\x{4E2D}\x{6574}\x{7406}\x{60A8}\x{7684}\x{61C9}\x{7528}\x{7A0B}\x{5F0F}\x{FF0C}\x{4E00}\x{65E6}\x{540C}\x{6B65}\x{4E4B}\x{5F8C}\x{FF0C}iPhone \x{6216} iPod touch \x{5C31}\x{6703}"
text run at (55,0) width 146: "\x{81EA}\x{52D5}\x{51FA}\x{73FE}\x{60A8}\x{6240}\x{5B89}\x{6392}\x{7684}\x{914D}\x{7F6E}\x{3002}"
RenderBlock {P} at (324,12) size 126x550
RenderText {#text} at (1,0) size 123x550
text run at (1,0) width 550: "\x{4ECA}\x{5E74}\x{590F}\x{5929}\x{63A8}\x{51FA}\x{7684} iPhone OS 3.0 \x{70BA} iPhone \x{548C} iPod touch \x{4F7F}\x{7528}\x{8005}\x{63D0}\x{4F9B}\x{4E86} 100 \x{591A}\x{7A2E}\x{5168}\x{65B0}\x{7684}\x{529F}\x{80FD}\x{FF0C}"
text run at (19,0) width 550: "\x{5305}\x{62EC}\x{FF1A}\x{526A}\x{8CBC}\x{8207}\x{62F7}\x{8C9D}\x{FF1B}MMS\x{FF1B}\x{65B0}\x{589E}\x{6A6B}\x{5411}\x{6AA2}\x{8996}\x{7684} Mail\x{3001}Text \x{548C} Notes\x{FF1B}\x{7ACB}\x{9AD4}\x{8072} Bluetooth\x{FF1B}\x{6416}\x{4E00}\x{6416}\x{5C31}"
text run at (37,0) width 550: "\x{96A8}\x{6A5F}\x{64AD}\x{653E}\x{FF1B}\x{96FB}\x{8996}\x{7BC0}\x{76EE}\x{5206}\x{7D1A}\x{4FDD}\x{8B77}\x{63A7}\x{5236}\x{FF1B}\x{81EA}\x{52D5}\x{767B}\x{5165} Wi-Fi \x{71B1}\x{9EDE}\x{FF1B}\x{4EE5}\x{53CA} Push Notification \x{670D}\x{52D9}\x{901A}\x{77E5}\x{7B49}"
text run at (55,0) width 550: "\x{7B49}\x{3002}\x{9019}\x{4E9B}\x{65B0}\x{589E}\x{529F}\x{80FD}\x{53D7}\x{5230}\x{5BA2}\x{6236}\x{7684}\x{5EE3}\x{5927}\x{6B61}\x{8FCE}\x{FF0C}\x{622A}\x{81F3}\x{76EE}\x{524D}\x{70BA}\x{6B62}\x{FF0C}\x{5DF2}\x{7D93}\x{6709}\x{8D85}\x{904E} 20 \x{5104}\x{6B21}\x{7684} Push"
text run at (73,0) width 550: "Notification \x{670D}\x{52D9}\x{901A}\x{77E5}\x{767C}\x{9001}\x{81F3} App Store \x{61C9}\x{7528}\x{7A0B}\x{5F0F}\x{3002}\x{6B64}\x{5916}\x{FF0C}\x{6700}\x{8FD1}\x{63A8}\x{51FA}\x{7684}\x{61C9}\x{7528}\x{7A0B}\x{5F0F}\x{5167}\x{8CFC}\x{8CB7}\x{6A5F}\x{5236} (In-"
text run at (91,0) width 550: "App Purchase)\x{FF0C}\x{70BA}\x{9818}\x{5148}\x{7684}\x{61C9}\x{7528}\x{7A0B}\x{5F0F}\x{958B}\x{767C}\x{5EE0}\x{5546}\x{63D0}\x{4F9B}\x{4E86}\x{4E00}\x{7A2E}\x{65B9}\x{5F0F}\x{8B93}\x{5BA2}\x{6236}\x{76F4}\x{63A5}\x{5F9E}\x{61C9}\x{7528}\x{7A0B}\x{5F0F}\x{7576}\x{4E2D}\x{8CFC}\x{8CB7}\x{5167}"
text run at (109,0) width 146: "\x{5BB9}\x{3001}\x{8A02}\x{95B1}\x{9805}\x{76EE}\x{53CA}\x{6578}\x{4F4D}\x{670D}\x{52D9}\x{3002}"
2011-01-26 Dan Bernstein <mitz@apple.com>
Reviewed by Dave Hyatt.
<rdar://problem/8446709> Allow inter-ideograph justification for CJK
https://bugs.webkit.org/show_bug.cgi?id=53184
Tests: fast/text/justify-ideograph-complex.html
fast/text/justify-ideograph-simple.html
fast/text/justify-ideograph-vertical.html
* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::drawTextInternal): Corrected the type of the third parameter
passed to the TextRun constructor and added the trailingExpansionBehavior parameter.
* platform/graphics/Font.cpp:
(WebCore::Font::expansionOpportunityCount): Added. Returns the number of expansion opportunities
for text justification. On entry, isAfterExpansion says whether an expansion opportunity exists
before the first character. On return, isAfterExpansion says whether an expansion opportunity
exists after the last character.
* platform/graphics/Font.h:
* platform/graphics/GlyphBuffer.h:
(WebCore::GlyphBuffer::expandLastAdvance): Added.
* platform/graphics/TextRun.h:
(WebCore::TextRun::TextRun): Added a TrailingExpansionBehavior parameter to the constructors.
Renamed padding to expansion.
(WebCore::TextRun::expansion): Renamed padding() to this.
(WebCore::TextRun::allowsTrailingExpansion): Added this accessor.
* platform/graphics/WidthIterator.cpp:
(WebCore::WidthIterator::WidthIterator): Initialize m_isAfterExpansion. Use Font::expansionOpportunityCount()
and adjust the count if it includes a trailing expansion opportunity but the run disallows trailing
expansion.
(WebCore::WidthIterator::advance): Apply expansion before and after CJK ideographs.
(WebCore::WidthIterator::advanceOneCharacter): Changed to not clear the GlyphBuffer so that advance()
can expand the last advance if it is followed by a CJK ideograph.
* platform/graphics/WidthIterator.h: Renamed m_padding to m_expansion and m_padPerSpace
to m_expansionPerOpportunity.
* platform/graphics/chromium/FontChromiumWin.cpp:
(WebCore::Font::canExpandAroundIdeographsInComplexText): Added.
* platform/graphics/chromium/FontLinux.cpp:
(WebCore::Font::canExpandAroundIdeographsInComplexText): Added.
* platform/graphics/efl/FontEfl.cpp:
(WebCore::Font::canExpandAroundIdeographsInComplexText): Added.
* platform/graphics/gtk/FontGtk.cpp:
(WebCore::Font::canExpandAroundIdeographsInComplexText): Added.
* platform/graphics/haiku/FontHaiku.cpp:
(WebCore::Font::canExpandAroundIdeographsInComplexText): Added.
* platform/graphics/mac/ComplexTextController.cpp:
(WebCore::ComplexTextController::ComplexTextController): Initialize m_isAfterExpansion. Use
Font::expansionOpportunityCount() and adjust the count if it includes a trailing expansion
opportunity but the run disallows trailing expansion.
(WebCore::ComplexTextController::adjustGlyphsAndAdvances): Moved the definition and initialization
of hasExtraSpacing outside the loop. Apply expansion before and after CJK ideographs.
* platform/graphics/mac/ComplexTextController.h: Renamed m_padding to m_expansion and m_padPerSpace
to m_expansionPerOpportunity.
* platform/graphics/mac/FontMac.mm:
(WebCore::Font::canExpandAroundIdeographsInComplexText): Added.
* platform/graphics/qt/FontQt.cpp:
(WebCore::Font::canExpandAroundIdeographsInComplexText): Added.
* platform/graphics/win/FontWin.cpp:
(WebCore::Font::canExpandAroundIdeographsInComplexText): Added.
* platform/graphics/win/UniscribeController.cpp:
(WebCore::UniscribeController::UniscribeController): Updated for rename.
* platform/graphics/wince/FontWinCE.cpp:
(WebCore::Font::canExpandAroundIdeographsInComplexText): Added.
* platform/graphics/wx/FontWx.cpp:
(WebCore::Font::canExpandAroundIdeographsInComplexText): Added.
* rendering/EllipsisBox.cpp:
(WebCore::EllipsisBox::paint): Pass a TrailingExpansionBehavior to the TextRun constructor.
(WebCore::EllipsisBox::selectionRect): Ditto.
(WebCore::EllipsisBox::paintSelection): Ditto.
* rendering/InlineBox.h:
(WebCore::InlineBox::InlineBox): Renamed m_toAdd to m_expansion.
(WebCore::InlineBox::expansion): Renamed toAdd() to this.
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::selectionRect): Pass a TrailingExpansionBehavior to the TextRun constructor.
(WebCore::InlineTextBox::paint): Ditto.
(WebCore::InlineTextBox::paintSelection): Ditto.
(WebCore::InlineTextBox::paintCompositionBackground): Ditto.
(WebCore::InlineTextBox::paintSpellingOrGrammarMarker): Ditto.
(WebCore::InlineTextBox::paintTextMatchMarker): Ditto.
(WebCore::InlineTextBox::computeRectForReplacementMarker): Ditto.
(WebCore::InlineTextBox::offsetForPosition): Ditto.
(WebCore::InlineTextBox::positionForOffset): Ditto.
* rendering/InlineTextBox.h:
(WebCore::InlineTextBox::setExpansion): Renamed setSpaceAdd() to this.
(WebCore::InlineTextBox::trailingExpansionBehavior): Added. Trailing expansion is allowed if this
is not the last leaf box on the line.
* rendering/RenderBlockLineLayout.cpp:
(WebCore::RenderBlock::computeInlineDirectionPositionsForLine): Keep expansion opportunity counts
in a vector instead of computing them twice. Discard the trailing expansion opportunity in the
last text box.
* rendering/RenderFileUploadControl.cpp:
(WebCore::RenderFileUploadControl::paintObject): Pass a TrailingExpansionBehavior to the TextRun constructor.
(WebCore::RenderFileUploadControl::computePreferredLogicalWidths): Ditto.
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::updateFromElement): Ditto.
(WebCore::RenderListBox::paintItemForeground): Ditto. Also corrected the type of the second parameter.
* rendering/RenderTextControl.cpp:
(WebCore::RenderTextControl::getAvgCharWidth): Ditto.
(WebCore::RenderTextControl::paintPlaceholder): Ditto.
* rendering/svg/SVGInlineTextBox.cpp:
(WebCore::SVGInlineTextBox::constructTextRun): Ditto.
2011-01-26 Andy Estes <aestes@apple.com>
Rubber-stamped by Darin Adler.
......@@ -1771,7 +1771,7 @@ void CanvasRenderingContext2D::drawTextInternal(const String& text, float x, flo
unsigned length = text.length();
const UChar* string = text.characters();
TextRun textRun(string, length, 0, 0, 0, rtl, override, false, false);
TextRun textRun(string, length, false, 0, 0, TextRun::AllowTrailingExpansion, rtl, override, false, false);
// Draw the item text at the correct point.
FloatPoint location(x, y);
......@@ -1793,7 +1793,7 @@ void CanvasRenderingContext2D::drawTextInternal(const String& text, float x, flo
break;
}
float width = font.width(TextRun(text, false, 0, 0, rtl, override));
float width = font.width(TextRun(text, false, 0, 0, TextRun::AllowTrailingExpansion, rtl, override));
TextAlign align = state().m_textAlign;
if (align == StartTextAlign)
......
......@@ -973,7 +973,7 @@ void PopupListBox::paintRow(GraphicsContext* gc, const IntRect& rect, int rowInd
else if (m_settings.itemTextDirectionalityHint ==
PopupContainerSettings::FirstStrongDirectionalCharacterDirection)
rtl = itemText.defaultWritingDirection() == WTF::Unicode::RightToLeft;
TextRun textRun(itemText.characters(), itemText.length(), false, 0, 0, rtl);
TextRun textRun(itemText.characters(), itemText.length(), false, 0, 0, TextRun::AllowTrailingExpansion, rtl);
// If the text is right-to-left, make it right-aligned by adjusting its
// beginning position.
if (rightAligned)
......@@ -1001,7 +1001,7 @@ void PopupListBox::paintRow(GraphicsContext* gc, const IntRect& rect, int rowInd
// Draw the the label if applicable.
if (itemLabel.isEmpty())
return;
TextRun labelTextRun(itemLabel.characters(), itemLabel.length(), false, 0, 0, rtl);
TextRun labelTextRun(itemLabel.characters(), itemLabel.length(), false, 0, 0, TextRun::AllowTrailingExpansion, rtl);
if (rightAligned)
textX = max(0, m_popupClient->clientPaddingLeft() - m_popupClient->clientInsetLeft());
else
......
......@@ -2,7 +2,7 @@
* Copyright (C) 1999 Lars Knoll (knoll@kde.org)
* (C) 1999 Antti Koivisto (koivisto@kde.org)
* (C) 2000 Dirk Mueller (mueller@kde.org)
* Copyright (C) 2003, 2006, 2010 Apple Inc. All rights reserved.
* Copyright (C) 2003, 2006, 2010, 2011 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
......@@ -293,7 +293,7 @@ Font::CodePath Font::codePath(const TextRun& run) const
return s_codePath;
#if PLATFORM(QT)
if (run.padding() || run.rtl() || isSmallCaps() || wordSpacing() || letterSpacing())
if (run.expansion() || run.rtl() || isSmallCaps() || wordSpacing() || letterSpacing())
return Complex;
#endif
......@@ -458,6 +458,33 @@ bool Font::isCJKIdeographOrSymbol(UChar32 c)
return isCJKIdeograph(c);
}
unsigned Font::expansionOpportunityCount(const UChar* characters, size_t length, bool& isAfterExpansion)
{
static bool expandAroundIdeographs = canExpandAroundIdeographsInComplexText();
unsigned count = 0;
for (size_t i = 0; i < length; ++i) {
UChar32 character = characters[i];
if (treatAsSpace(character)) {
count++;
isAfterExpansion = true;
continue;
}
if (U16_IS_LEAD(character) && i + 1 < length && U16_IS_TRAIL(characters[i + 1])) {
character = U16_GET_SUPPLEMENTARY(character, characters[i + 1]);
i++;
}
if (expandAroundIdeographs && isCJKIdeograph(character)) {
if (!isAfterExpansion)
count++;
count++;
isAfterExpansion = true;
continue;
}
isAfterExpansion = false;
}
return count;
}
bool Font::canReceiveTextEmphasis(UChar32 c)
{
CharCategory category = Unicode::category(c);
......
......@@ -2,7 +2,7 @@
* Copyright (C) 2000 Lars Knoll (knoll@kde.org)
* (C) 2000 Antti Koivisto (koivisto@kde.org)
* (C) 2000 Dirk Mueller (mueller@kde.org)
* Copyright (C) 2003, 2006, 2007, 2010 Apple Inc. All rights reserved.
* Copyright (C) 2003, 2006, 2007, 2010, 2011 Apple Inc. All rights reserved.
* Copyright (C) 2008 Holger Hans Peter Freyther
*
* This library is free software; you can redistribute it and/or
......@@ -142,7 +142,9 @@ public:
static bool isCJKIdeograph(UChar32);
static bool isCJKIdeographOrSymbol(UChar32);
static unsigned expansionOpportunityCount(const UChar*, size_t length, bool& isAfterExpansion);
#if PLATFORM(QT)
QFont font() const;
#endif
......@@ -177,6 +179,7 @@ private:
bool getEmphasisMarkGlyphData(const AtomicString&, GlyphData&) const;
static bool canReturnFallbackFontsForComplexText();
static bool canExpandAroundIdeographsInComplexText();
CodePath codePath(const TextRun&) const;
......
/*
* Copyright (C) 2006, 2009 Apple Inc. All rights reserved.
* Copyright (C) 2006, 2009, 2011 Apple Inc. All rights reserved.
* Copyright (C) 2007-2008 Torch Mobile Inc.
*
* Redistribution and use in source and binary forms, with or without
......@@ -187,7 +187,20 @@ public:
m_advances.append(advance);
}
#endif
void expandLastAdvance(float width)
{
ASSERT(!isEmpty());
GlyphBufferAdvance& lastAdvance = m_advances.last();
#if PLATFORM(CG) || (PLATFORM(WX) && OS(DARWIN))
lastAdvance.width += width;
#elif OS(WINCE)
lastAdvance += width;
#else
lastAdvance += FloatSize(width, 0);
#endif
}
private:
Vector<const SimpleFontData*, 2048> m_fontData;
Vector<GlyphBufferGlyph, 2048> m_glyphs;
......
......@@ -2,7 +2,7 @@
* Copyright (C) 2000 Lars Knoll (knoll@kde.org)
* (C) 2000 Antti Koivisto (koivisto@kde.org)
* (C) 2000 Dirk Mueller (mueller@kde.org)
* Copyright (C) 2003, 2006, 2007 Apple Computer, Inc.
* Copyright (C) 2003, 2006, 2007, 2011 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
......@@ -33,12 +33,18 @@ class RenderSVGResource;
class TextRun {
public:
TextRun(const UChar* c, int len, bool allowTabs = false, int xpos = 0, int padding = 0, bool rtl = false, bool directionalOverride = false,
enum TrailingExpansionBehavior {
AllowTrailingExpansion,
ForbidTrailingExpansion
};
TextRun(const UChar* c, int len, bool allowTabs = false, int xpos = 0, int expansion = 0, TrailingExpansionBehavior trailingExpansionBehavior = AllowTrailingExpansion, bool rtl = false, bool directionalOverride = false,
bool applyRunRounding = true, bool applyWordRounding = true)
: m_characters(c)
, m_len(len)
, m_xpos(xpos)
, m_padding(padding)
, m_expansion(expansion)
, m_trailingExpansionBehavior(trailingExpansionBehavior)
#if ENABLE(SVG)
, m_horizontalGlyphStretch(1)
#endif
......@@ -55,12 +61,13 @@ public:
{
}
TextRun(const String& s, bool allowTabs = false, int xpos = 0, int padding = 0, bool rtl = false, bool directionalOverride = false,
TextRun(const String& s, bool allowTabs = false, int xpos = 0, int expansion = 0, TrailingExpansionBehavior trailingExpansionBehavior = AllowTrailingExpansion, bool rtl = false, bool directionalOverride = false,
bool applyRunRounding = true, bool applyWordRounding = true)
: m_characters(s.characters())
, m_len(s.length())
, m_xpos(xpos)
, m_padding(padding)
, m_expansion(expansion)
, m_trailingExpansionBehavior(trailingExpansionBehavior)
#if ENABLE(SVG)
, m_horizontalGlyphStretch(1)
#endif
......@@ -92,7 +99,8 @@ public:
bool allowTabs() const { return m_allowTabs; }
int xPos() const { return m_xpos; }
int padding() const { return m_padding; }
int expansion() const { return m_expansion; }
bool allowsTrailingExpansion() const { return m_trailingExpansionBehavior == AllowTrailingExpansion; }
bool rtl() const { return m_rtl; }
bool ltr() const { return !m_rtl; }
bool directionalOverride() const { return m_directionalOverride; }
......@@ -121,7 +129,8 @@ private:
// start of the containing block. In the case of right alignment or center alignment, left start of
// the text line is not the same as left start of the containing block.
int m_xpos;
int m_padding;
int m_expansion;
TrailingExpansionBehavior m_trailingExpansionBehavior;
#if ENABLE(SVG)
float m_horizontalGlyphStretch;
#endif
......
/*
* Copyright (C) 2003, 2006, 2008, 2009, 2010 Apple Inc. All rights reserved.
* Copyright (C) 2003, 2006, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
* Copyright (C) 2008 Holger Hans Peter Freyther
*
* This library is free software; you can redistribute it and/or
......@@ -47,6 +47,7 @@ WidthIterator::WidthIterator(const Font* font, const TextRun& run, HashSet<const
, m_end(run.length())
, m_currentCharacter(0)
, m_runWidthSoFar(0)
, m_isAfterExpansion(true)
, m_finalRoundingWidth(0)
, m_fallbackFonts(fallbackFonts)
, m_accountForGlyphBounds(accountForGlyphBounds)
......@@ -58,20 +59,19 @@ WidthIterator::WidthIterator(const Font* font, const TextRun& run, HashSet<const
{
// If the padding is non-zero, count the number of spaces in the run
// and divide that by the padding for per space addition.
m_padding = m_run.padding();
if (!m_padding)
m_padPerSpace = 0;
m_expansion = m_run.expansion();
if (!m_expansion)
m_expansionPerOpportunity = 0;
else {
int numSpaces = 0;
for (int i = 0; i < run.length(); i++) {
if (Font::treatAsSpace(m_run[i]))
numSpaces++;
}
bool isAfterExpansion = true;
unsigned expansionOpportunityCount = Font::expansionOpportunityCount(m_run.characters(), m_end, isAfterExpansion);
if (isAfterExpansion && !m_run.allowsTrailingExpansion())
expansionOpportunityCount--;
if (!numSpaces)
m_padPerSpace = 0;
if (!expansionOpportunityCount)
m_expansionPerOpportunity = 0;
else
m_padPerSpace = m_padding / numSpaces;
m_expansionPerOpportunity = m_expansion / expansionOpportunityCount;
}
}
......@@ -84,7 +84,7 @@ void WidthIterator::advance(int offset, GlyphBuffer* glyphBuffer)
const UChar* cp = m_run.data(currentCharacter);
bool rtl = m_run.rtl();
bool hasExtraSpacing = (m_font->letterSpacing() || m_font->wordSpacing() || m_padding) && !m_run.spacingDisabled();
bool hasExtraSpacing = (m_font->letterSpacing() || m_font->wordSpacing() || m_expansion) && !m_run.spacingDisabled();
float widthSinceLastRounding = m_runWidthSoFar;
m_runWidthSoFar = floorf(m_runWidthSoFar);
......@@ -173,26 +173,33 @@ void WidthIterator::advance(int offset, GlyphBuffer* glyphBuffer)
if (width && m_font->letterSpacing())
width += m_font->letterSpacing();
if (Font::treatAsSpace(c)) {
// Account for padding. WebCore uses space padding to justify text.
// We distribute the specified padding over the available spaces in the run.
if (m_padding) {
// Use left over padding if not evenly divisible by number of spaces.
if (m_padding < m_padPerSpace) {
width += m_padding;
m_padding = 0;
} else {
float previousPadding = m_padding;
m_padding -= m_padPerSpace;
width += roundf(previousPadding) - roundf(m_padding);
static bool expandAroundIdeographs = Font::canExpandAroundIdeographsInComplexText();
bool treatAsSpace = Font::treatAsSpace(c);
if (treatAsSpace || (expandAroundIdeographs && Font::isCJKIdeograph(c))) {
// Distribute the run's total expansion evenly over all expansion opportunities in the run.