Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8d087c34 authored by Raph Levien's avatar Raph Levien
Browse files

Make zero width space a line breaker

This patch makes ZWSP (U+200B, zero width space) a potential line break
in text layouts. This is a fix for bug 8501809.

Change-Id: I18c1f8464e6c821ff75f819141bacc714a878700
parent aad37a1e
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -340,7 +340,7 @@ public class StaticLayout extends Layout {
                        w += widths[j - paraStart];
                    }

                    boolean isSpaceOrTab = c == CHAR_SPACE || c == CHAR_TAB;
                    boolean isSpaceOrTab = c == CHAR_SPACE || c == CHAR_TAB || c == CHAR_ZWSP;

                    if (w <= width || isSpaceOrTab) {
                        fitWidth = w;
@@ -956,6 +956,7 @@ public class StaticLayout extends Layout {
    private static final char CHAR_SPACE = ' ';
    private static final char CHAR_SLASH = '/';
    private static final char CHAR_HYPHEN = '-';
    private static final char CHAR_ZWSP = '\u200B';

    private static final double EXTRA_ROUNDING = 0.5;