Set useLineSpacingFromFallbacks when measuring text

Summary:
Changelog: [internal]

When paper measures text, it sets `useLineSpacingFromFallbacks` flag on the Layout object. In Fabric this was missing and can cause incorrect layout.

Reviewed By: JoshuaGross

Differential Revision: D23845441

fbshipit-source-id: 538f440cdbbf8df2cba0458837b80db103888113
This commit is contained in:
Samuel Susla
2020-09-23 06:03:11 -07:00
committed by Facebook GitHub Bot
parent e125f12c01
commit 246f746942
@@ -326,14 +326,19 @@ public class TextLayoutManager {
0.f,
includeFontPadding);
} else {
layout =
StaticLayout.Builder builder =
StaticLayout.Builder.obtain(text, 0, spanLength, textPaint, (int) width)
.setAlignment(Layout.Alignment.ALIGN_NORMAL)
.setLineSpacing(0.f, 1.f)
.setIncludePad(includeFontPadding)
.setBreakStrategy(textBreakStrategy)
.setHyphenationFrequency(Layout.HYPHENATION_FREQUENCY_NORMAL)
.build();
.setHyphenationFrequency(Layout.HYPHENATION_FREQUENCY_NORMAL);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
builder.setUseLineSpacingFromFallbacks(true);
}
layout = builder.build();
}
}
return layout;