diff --git a/txt/src/minikin/LineBreaker.cpp b/txt/src/minikin/LineBreaker.cpp index 32016e0f094e1cf7e4ccf4e5d4c18507c4f56a6e..353018fa8e6ec6371d5a6493b29960f5dd45318e 100644 --- a/txt/src/minikin/LineBreaker.cpp +++ b/txt/src/minikin/LineBreaker.cpp @@ -129,13 +129,12 @@ float LineBreaker::addStyleRun(MinikinPaint* paint, size_t end, bool isRtl) { float width = 0.0f; - int bidiFlags = isRtl ? kBidi_Force_RTL : kBidi_Force_LTR; float hyphenPenalty = 0.0; if (paint != nullptr) { width = Layout::measureText(mTextBuf.data(), start, end - start, - mTextBuf.size(), bidiFlags, style, *paint, - typeface, mCharWidths.data() + start); + mTextBuf.size(), isRtl, style, *paint, typeface, + mCharWidths.data() + start); // a heuristic that seems to perform well hyphenPenalty = @@ -202,12 +201,12 @@ float LineBreaker::addStyleRun(MinikinPaint* paint, paint->hyphenEdit = HyphenEdit::editForThisLine(hyph); const float firstPartWidth = Layout::measureText( mTextBuf.data(), lastBreak, j - lastBreak, mTextBuf.size(), - bidiFlags, style, *paint, typeface, nullptr); + isRtl, style, *paint, typeface, nullptr); ParaWidth hyphPostBreak = lastBreakWidth + firstPartWidth; paint->hyphenEdit = HyphenEdit::editForNextLine(hyph); const float secondPartWidth = Layout::measureText( - mTextBuf.data(), j, afterWord - j, mTextBuf.size(), bidiFlags, + mTextBuf.data(), j, afterWord - j, mTextBuf.size(), isRtl, style, *paint, typeface, nullptr); ParaWidth hyphPreBreak = postBreak - secondPartWidth;