Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(385)

Unified Diff: trunk/Source/platform/fonts/Font.cpp

Issue 146503002: Revert 165189 "Rendering text-justify:distribute for 8 bit chara..." (Closed) Base URL: svn://svn.chromium.org/blink/
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « trunk/Source/platform/fonts/Font.h ('k') | trunk/Source/platform/fonts/WidthIterator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/Source/platform/fonts/Font.cpp
===================================================================
--- trunk/Source/platform/fonts/Font.cpp (revision 165706)
+++ trunk/Source/platform/fonts/Font.cpp (working copy)
@@ -526,33 +526,30 @@
return valueInIntervalList(cjkSymbolRanges, c);
}
-unsigned Font::expansionOpportunityCount(const LChar* characters, size_t length, TextDirection direction, bool& isAfterExpansion, bool distributeJustification)
+unsigned Font::expansionOpportunityCount(const LChar* characters, size_t length, TextDirection direction, bool& isAfterExpansion)
{
unsigned count = 0;
if (direction == LTR) {
for (size_t i = 0; i < length; ++i) {
- if (treatAsSpace(characters[i]) || distributeJustification)
+ if (treatAsSpace(characters[i])) {
count++;
+ isAfterExpansion = true;
+ } else
+ isAfterExpansion = false;
}
- if (treatAsSpace(characters[length - 1]))
- isAfterExpansion = true;
- else
- isAfterExpansion = false;
} else {
for (size_t i = length; i > 0; --i) {
- if (treatAsSpace(characters[i - 1]) || distributeJustification)
+ if (treatAsSpace(characters[i - 1])) {
count++;
+ isAfterExpansion = true;
+ } else
+ isAfterExpansion = false;
}
- if (treatAsSpace(characters[0]))
- isAfterExpansion = true;
- else
- isAfterExpansion = false;
}
return count;
}
-// FIXME: need to take care of text-justify:distribute case
-unsigned Font::expansionOpportunityCount(const UChar* characters, size_t length, TextDirection direction, bool& isAfterExpansion, bool distributeJustification)
+unsigned Font::expansionOpportunityCount(const UChar* characters, size_t length, TextDirection direction, bool& isAfterExpansion)
{
static bool expandAroundIdeographs = canExpandAroundIdeographsInComplexText();
unsigned count = 0;
« no previous file with comments | « trunk/Source/platform/fonts/Font.h ('k') | trunk/Source/platform/fonts/WidthIterator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698