• R
    Consistently apply break opportunities in text spans · e9ec9a1d
    Raph Levien 提交于
    It's essential not to apply a break opportunity within a replacement
    span, otherwise things can happen such as displaying the span twice.
    The old code tested this case based on zero-width characters.
    However, this test was both imprecise, and also in some cases read
    uninitialized values from the mCharWidths array, which in turn led
    to inconsistent line breaking of the same text.
    
    This patch applies all line break opportunities (as identified by
    ICU) within text (as opposed to replacement spans), and also applies
    break opportunities at the beginning and end of replacement spans,
    but avoids breaks within a replacement span.
    
    Bug: 20138621
    Change-Id: I36baeb44d6808356649e1bb69ca57f093fc8c723
    e9ec9a1d
LineBreaker.cpp 17.2 KB