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

Unified Diff: Source/platform/fonts/Character.cpp

Issue 766053004: text-justify fix for Chinese and Japanese (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: One more NeedsRebaseline for Linux and Win Created 6 years 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
Index: Source/platform/fonts/Character.cpp
diff --git a/Source/platform/fonts/Character.cpp b/Source/platform/fonts/Character.cpp
index 9ae36fc83ca78d1ffee41b510d576eb556914cdd..8a1308f8fd88bf2353298a13bb72be9df3380d74 100644
--- a/Source/platform/fonts/Character.cpp
+++ b/Source/platform/fonts/Character.cpp
@@ -378,6 +378,13 @@ unsigned Character::expansionOpportunityCount(const UChar* characters, size_t le
character = U16_GET_SUPPLEMENTARY(character, characters[i + 1]);
i++;
}
+ if (textJustify == TextJustify::TextJustifyAuto && isCJKIdeographOrSymbol(character)) {
+ if (!isAfterExpansion)
+ count++;
+ count++;
+ isAfterExpansion = true;
+ continue;
+ }
isAfterExpansion = false;
}
} else {
@@ -392,6 +399,13 @@ unsigned Character::expansionOpportunityCount(const UChar* characters, size_t le
character = U16_GET_SUPPLEMENTARY(characters[i - 2], character);
i--;
}
+ if (textJustify == TextJustify::TextJustifyAuto && isCJKIdeographOrSymbol(character)) {
+ if (!isAfterExpansion)
+ count++;
+ count++;
+ isAfterExpansion = true;
+ continue;
+ }
isAfterExpansion = false;
}
}
« no previous file with comments | « LayoutTests/fast/text/justify-ideograph-leading-expansion.html ('k') | Source/platform/fonts/shaping/SimpleShaper.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698