Commit 12122bf
Support surrogate pairs when layouting text
The current framework does not consider surrogate pairs
when getting the index of the character. This bug becomes
visible when creating the text including Emojis. For
example cursor breaks up when it moves around the Emojis.
Our proposed solution will consider the surrogate pairs
when calculating the index. It will fix not only the Emoji
case, but also the letters that use surrogate pairs.
Change-Id: I4983f2e4df933c8af9d5f0cc27df871e8e10fed41 parent f3ee6f8 commit 12122bf
File tree
3 files changed
+35
-10
lines changed- core/java/android/text
3 files changed
+35
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
749 | 749 | | |
750 | 750 | | |
751 | 751 | | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
752 | 755 | | |
753 | 756 | | |
754 | 757 | | |
| |||
893 | 896 | | |
894 | 897 | | |
895 | 898 | | |
896 | | - | |
| 899 | + | |
897 | 900 | | |
898 | 901 | | |
899 | 902 | | |
| |||
993 | 996 | | |
994 | 997 | | |
995 | 998 | | |
996 | | - | |
| 999 | + | |
997 | 1000 | | |
998 | 1001 | | |
999 | 1002 | | |
| |||
1564 | 1567 | | |
1565 | 1568 | | |
1566 | 1569 | | |
1567 | | - | |
| 1570 | + | |
| 1571 | + | |
1568 | 1572 | | |
1569 | 1573 | | |
1570 | 1574 | | |
| |||
1958 | 1962 | | |
1959 | 1963 | | |
1960 | 1964 | | |
1961 | | - | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
313 | 313 | | |
314 | 314 | | |
315 | 315 | | |
316 | | - | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
317 | 319 | | |
318 | 320 | | |
319 | 321 | | |
320 | 322 | | |
321 | 323 | | |
322 | 324 | | |
323 | 325 | | |
324 | | - | |
325 | | - | |
326 | | - | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
327 | 331 | | |
328 | 332 | | |
329 | 333 | | |
| |||
966 | 970 | | |
967 | 971 | | |
968 | 972 | | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
969 | 989 | | |
970 | 990 | | |
971 | 991 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
203 | 203 | | |
204 | 204 | | |
205 | 205 | | |
| 206 | + | |
206 | 207 | | |
207 | 208 | | |
208 | | - | |
| 209 | + | |
209 | 210 | | |
210 | 211 | | |
211 | 212 | | |
| |||
214 | 215 | | |
215 | 216 | | |
216 | 217 | | |
| 218 | + | |
217 | 219 | | |
218 | | - | |
| 220 | + | |
219 | 221 | | |
220 | 222 | | |
221 | 223 | | |
| |||
0 commit comments