diff --git a/packages/react-native/ReactCommon/react/renderer/textlayoutmanager/TextMeasureCache.h b/packages/react-native/ReactCommon/react/renderer/textlayoutmanager/TextMeasureCache.h index 69cc621aaf75..b1b5b368a65d 100644 --- a/packages/react-native/ReactCommon/react/renderer/textlayoutmanager/TextMeasureCache.h +++ b/packages/react-native/ReactCommon/react/renderer/textlayoutmanager/TextMeasureCache.h @@ -9,6 +9,8 @@ #include +#include + #include #include #include @@ -72,6 +74,8 @@ class TextMeasureCacheKey final { // are rounded to the pixel grid. Two otherwise-identical measures at different // densities are not interchangeable, so the scale factor is part of the key. Float pointScaleFactor{}; + // Android initializes its measurement paint from the paragraph's base attributes. + bool includeBaseTextAttributes{}; }; // The Key type that is used for Line Measure Cache. @@ -82,6 +86,7 @@ class LineMeasureCacheKey final { AttributedString attributedString{}; ParagraphAttributes paragraphAttributes{}; Size size{}; + bool includeBaseTextAttributes{}; }; /** @@ -209,6 +214,47 @@ inline size_t attributedStringFragmentHashDisplayWise(const AttributedString::Fr return facebook::react::hash_combine(fragment.string, fragment.textAttributes); } +inline auto androidBaseTextPaintAttributes(const AttributedString &attributedString) +{ + const auto &attributes = attributedString.getBaseTextAttributes(); + // Android's MapBuffer omits NaN values, regardless of their representation. + auto optionalFloat = [](Float value) -> std::optional { + return std::isnan(value) ? std::nullopt : std::optional{value}; + }; + + // Match TextLayoutManager.updateTextPaint and TextAttributeProps' SP conversion. + return std::tuple_cat( + std::tie( + attributes.fontFamily, + attributes.fontWeight, + attributes.fontStyle, + attributes.fontVariant, + attributes.fontVariationSettings, + attributes.allowFontScaling), + std::tuple{ + optionalFloat(attributes.fontSize), + optionalFloat(attributes.maxFontSizeMultiplier), + optionalFloat(attributes.letterSpacing)}); +} + +inline void hashAndroidBaseTextPaintAttributes(size_t &seed, const AttributedString &attributedString) +{ + std::apply( + [&seed](const auto &fontFamily, const auto &...optionals) { + hash_combine(seed, fontFamily); + hash_combine_optionals(seed, optionals...); + }, + androidBaseTextPaintAttributes(attributedString)); +} + +template +inline bool areAndroidBaseTextPaintAttributesEquivalent(const Key &lhs, const Key &rhs) +{ + return lhs.includeBaseTextAttributes == rhs.includeBaseTextAttributes && + (!lhs.includeBaseTextAttributes || + androidBaseTextPaintAttributes(lhs.attributedString) == androidBaseTextPaintAttributes(rhs.attributedString)); +} + inline bool areAttributedStringsEquivalentLayoutWise(const AttributedString &lhs, const AttributedString &rhs) { auto &lhsFragment = lhs.getFragments(); @@ -230,6 +276,10 @@ inline bool areAttributedStringsEquivalentLayoutWise(const AttributedString &lhs inline bool areAttributedStringsEquivalentDisplayWise(const AttributedString &lhs, const AttributedString &rhs) { + if (androidBaseTextPaintAttributes(lhs) != androidBaseTextPaintAttributes(rhs)) { + return false; + } + auto &lhsFragment = lhs.getFragments(); auto &rhsFragment = rhs.getFragments(); @@ -247,7 +297,7 @@ inline bool areAttributedStringsEquivalentDisplayWise(const AttributedString &lh return true; } -inline size_t attributedStringHashLayoutWise(const AttributedString &attributedString) +inline size_t attributedStringHashLayoutWise(const AttributedString &attributedString, bool includeBaseTextAttributes) { auto seed = size_t{0}; @@ -255,6 +305,9 @@ inline size_t attributedStringHashLayoutWise(const AttributedString &attributedS facebook::react::hash_combine(seed, attributedStringFragmentHashLayoutWise(fragment)); } + if (includeBaseTextAttributes) { + hashAndroidBaseTextPaintAttributes(seed, attributedString); + } return seed; } @@ -266,11 +319,16 @@ inline size_t attributedStringHashDisplayWise(const AttributedString &attributed facebook::react::hash_combine(seed, attributedStringFragmentHashDisplayWise(fragment)); } + hashAndroidBaseTextPaintAttributes(seed, attributedString); return seed; } inline bool operator==(const TextMeasureCacheKey &lhs, const TextMeasureCacheKey &rhs) { + if (!areAndroidBaseTextPaintAttributesEquivalent(lhs, rhs)) { + return false; + } + return areAttributedStringsEquivalentLayoutWise(lhs.attributedString, rhs.attributedString) && lhs.paragraphAttributes == rhs.paragraphAttributes && lhs.layoutConstraints == rhs.layoutConstraints && floatEquality(lhs.pointScaleFactor, rhs.pointScaleFactor); @@ -278,6 +336,10 @@ inline bool operator==(const TextMeasureCacheKey &lhs, const TextMeasureCacheKey inline bool operator==(const LineMeasureCacheKey &lhs, const LineMeasureCacheKey &rhs) { + if (!areAndroidBaseTextPaintAttributesEquivalent(lhs, rhs)) { + return false; + } + return areAttributedStringsEquivalentLayoutWise(lhs.attributedString, rhs.attributedString) && lhs.paragraphAttributes == rhs.paragraphAttributes && lhs.size == rhs.size; } @@ -298,7 +360,7 @@ struct hash { size_t operator()(const facebook::react::TextMeasureCacheKey &key) const { return facebook::react::hash_combine( - attributedStringHashLayoutWise(key.attributedString), + attributedStringHashLayoutWise(key.attributedString, key.includeBaseTextAttributes), key.paragraphAttributes, key.layoutConstraints, key.pointScaleFactor); @@ -310,7 +372,9 @@ struct hash { size_t operator()(const facebook::react::LineMeasureCacheKey &key) const { return facebook::react::hash_combine( - attributedStringHashLayoutWise(key.attributedString), key.paragraphAttributes, key.size); + attributedStringHashLayoutWise(key.attributedString, key.includeBaseTextAttributes), + key.paragraphAttributes, + key.size); } }; diff --git a/packages/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/android/react/renderer/textlayoutmanager/TextLayoutManager.cpp b/packages/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/android/react/renderer/textlayoutmanager/TextLayoutManager.cpp index bb58da7ef8f5..c25342b6ec33 100644 --- a/packages/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/android/react/renderer/textlayoutmanager/TextLayoutManager.cpp +++ b/packages/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/android/react/renderer/textlayoutmanager/TextLayoutManager.cpp @@ -194,7 +194,8 @@ TextMeasurement TextLayoutManager::measure( {.attributedString = attributedString, .paragraphAttributes = paragraphAttributes, .layoutConstraints = layoutConstraints, - .pointScaleFactor = layoutContext.pointScaleFactor}, + .pointScaleFactor = layoutContext.pointScaleFactor, + .includeBaseTextAttributes = true}, std::move(measureText)); measurement.size = layoutConstraints.clamp(measurement.size); @@ -288,7 +289,8 @@ LinesMeasurements TextLayoutManager::measureLines( : lineMeasureCache_.get( {.attributedString = attributedString, .paragraphAttributes = paragraphAttributes, - .size = size}, + .size = size, + .includeBaseTextAttributes = true}, std::move(doMeasureLines)); } diff --git a/packages/react-native/ReactCommon/react/renderer/textlayoutmanager/tests/TextLayoutManagerTest.cpp b/packages/react-native/ReactCommon/react/renderer/textlayoutmanager/tests/TextLayoutManagerTest.cpp index ac0593cd44c5..a2bbfb78533a 100644 --- a/packages/react-native/ReactCommon/react/renderer/textlayoutmanager/tests/TextLayoutManagerTest.cpp +++ b/packages/react-native/ReactCommon/react/renderer/textlayoutmanager/tests/TextLayoutManagerTest.cpp @@ -9,6 +9,8 @@ #include #include +#include +#include #include #include @@ -24,6 +26,118 @@ TEST(TextLayoutManagerTest, defaultTextAttributesAreLayoutEquivalent) { textAttributesHashLayoutWise(lhs), textAttributesHashLayoutWise(rhs)); } +namespace { +template +void checkAndroidBasePaintKeys( + const AttributedString& first, + const AttributedString& second, + Check check) { + check( + TextMeasureCacheKey{ + .attributedString = first, .includeBaseTextAttributes = true}, + TextMeasureCacheKey{ + .attributedString = second, .includeBaseTextAttributes = true}); + check( + LineMeasureCacheKey{ + .attributedString = first, .includeBaseTextAttributes = true}, + LineMeasureCacheKey{ + .attributedString = second, .includeBaseTextAttributes = true}); + check( + PreparedTextCacheKey{.attributedString = first}, + PreparedTextCacheKey{.attributedString = second}); +} +} // namespace + +TEST(TextLayoutManagerTest, androidBasePaintAffectsAllTextCacheKeys) { + AttributedString first; + TextAttributes inner; + inner.fontSize = 20; + first.appendFragment({.string = "Text", .textAttributes = inner}); + first.setBaseTextAttributes(inner); + + struct TestCase { + const char* name; + void (*change)(TextAttributes&); + }; + const std::array cases{{ + {"fontFamily", [](TextAttributes& a) { a.fontFamily = "serif"; }}, + {"fontWeight", + [](TextAttributes& a) { a.fontWeight = FontWeight::Weight700; }}, + {"fontStyle", [](TextAttributes& a) { a.fontStyle = FontStyle::Italic; }}, + {"fontVariant", + [](TextAttributes& a) { a.fontVariant = FontVariant::SmallCaps; }}, + {"fontVariationSettings", + [](TextAttributes& a) { a.fontVariationSettings = "'wght' 700"; }}, + {"allowFontScaling", + [](TextAttributes& a) { a.allowFontScaling = false; }}, + {"fontSize", [](TextAttributes& a) { a.fontSize = 44; }}, + {"maxFontSizeMultiplier", + [](TextAttributes& a) { a.maxFontSizeMultiplier = 2; }}, + {"letterSpacing", [](TextAttributes& a) { a.letterSpacing = 1; }}, + }}; + for (const auto& testCase : cases) { + SCOPED_TRACE(testCase.name); + auto second = first; + auto base = first.getBaseTextAttributes(); + testCase.change(base); + second.setBaseTextAttributes(base); + checkAndroidBasePaintKeys( + first, second, [](const auto& lhs, const auto& rhs) { + EXPECT_FALSE(lhs == rhs); + }); + } +} + +TEST(TextLayoutManagerTest, androidBaseFontSizeContributesToKeyHash) { + AttributedString first; + first.appendFragment({.string = "Text"}); + auto second = first; + TextAttributes base; + base.fontSize = 20; + first.setBaseTextAttributes(base); + base.fontSize = 44; + second.setBaseTextAttributes(base); + + checkAndroidBasePaintKeys( + first, second, [](const auto& lhs, const auto& rhs) { + using Key = std::decay_t; + EXPECT_NE(std::hash{}(lhs), std::hash{}(rhs)); + }); + + first.setBaseTextAttributes(TextAttributes{}); + base.fontSize = -std::numeric_limits::quiet_NaN(); + second.setBaseTextAttributes(base); + checkAndroidBasePaintKeys( + first, second, [](const auto& lhs, const auto& rhs) { + using Key = std::decay_t; + EXPECT_EQ(lhs, rhs); + EXPECT_EQ(std::hash{}(lhs), std::hash{}(rhs)); + }); +} + +TEST(TextLayoutManagerTest, basePaintDoesNotAffectKeysWithoutAndroidOptIn) { + AttributedString first; + first.appendFragment({.string = "Text"}); + auto second = first; + TextAttributes base; + base.fontSize = 44; + second.setBaseTextAttributes(base); + + const TextMeasureCacheKey sizeA{.attributedString = first}; + const TextMeasureCacheKey sizeB{.attributedString = second}; + EXPECT_EQ(sizeA, sizeB); + EXPECT_EQ( + std::hash{}(sizeA), + std::hash{}(sizeB)); + + const LineMeasureCacheKey lineA{.attributedString = first}; + const LineMeasureCacheKey lineB{.attributedString = second}; + EXPECT_EQ(lineA, lineB); + EXPECT_EQ( + std::hash{}(lineA), + std::hash{}(lineB)); +} + TEST(TextLayoutManagerTest, maxFontSizeMultiplierAffectsLayoutCacheEquality) { TextAttributes lhs; TextAttributes rhs; diff --git a/scripts/cxx-api/api-snapshots/ReactAndroidFrameworksCxx.api b/scripts/cxx-api/api-snapshots/ReactAndroidFrameworksCxx.api index 3c35ec2ee54e..5ea52584a900 100644 --- a/scripts/cxx-api/api-snapshots/ReactAndroidFrameworksCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAndroidFrameworksCxx.api @@ -697,6 +697,7 @@ concept facebook::react::TextLayoutManagerWithPreparedTextLayout = requires( AAssetManager* facebook::react::extractAssetManager(jni::alias_ref assetManager); JSI_EXPORT std::shared_ptr facebook::react::FBReactNativeSpec_ModuleProvider(const std::string& moduleName, const facebook::react::JavaTurboModule::InitParams& params); YGDirection facebook::react::yogaDirectionFromLayoutDirection(facebook::react::LayoutDirection direction); +auto facebook::react::androidBaseTextPaintAttributes(const facebook::react::AttributedString& attributedString); bool facebook::react::areAttributedStringFragmentsEquivalentDisplayWise(const facebook::react::AttributedString::Fragment& lhs, const facebook::react::AttributedString::Fragment& rhs); bool facebook::react::areAttributedStringFragmentsEquivalentLayoutWise(const facebook::react::AttributedString::Fragment& lhs, const facebook::react::AttributedString::Fragment& rhs); bool facebook::react::areAttributedStringsEquivalentDisplayWise(const facebook::react::AttributedString& lhs, const facebook::react::AttributedString& rhs); @@ -781,7 +782,7 @@ int facebook::react::toInt(const facebook::react::LayoutDirection& layoutDirecti size_t facebook::react::attributedStringFragmentHashDisplayWise(const facebook::react::AttributedString::Fragment& fragment); size_t facebook::react::attributedStringFragmentHashLayoutWise(const facebook::react::AttributedString::Fragment& fragment); size_t facebook::react::attributedStringHashDisplayWise(const facebook::react::AttributedString& attributedString); -size_t facebook::react::attributedStringHashLayoutWise(const facebook::react::AttributedString& attributedString); +size_t facebook::react::attributedStringHashLayoutWise(const facebook::react::AttributedString& attributedString, bool includeBaseTextAttributes); size_t facebook::react::textAttributesHashLayoutWise(const facebook::react::TextAttributes& textAttributes); std::optional facebook::react::blendModeFromString(std::string_view blendModeName); std::optional facebook::react::filterTypeFromString(std::string_view filterName); @@ -849,6 +850,8 @@ template facebook::react::ComponentDescriptorProvider facebook::react::concreteComponentDescriptorProvider(); template DestinationTimePointT facebook::react::clockCast(SourceTimePointT timePoint); +template +bool facebook::react::areAndroidBaseTextPaintAttributesEquivalent(const Key& lhs, const Key& rhs); template T facebook::react::convertRawProp(const facebook::react::PropsParserContext& context, const facebook::react::RawProps& rawProps, const char* name, const T& sourceValue, const U& defaultValue); template @@ -957,6 +960,7 @@ void facebook::react::fromRawValueShared(const facebook::react::ContextContainer void facebook::react::fromString(const std::string& string, facebook::react::AccessibilityTraits& result); void facebook::react::g_setNativeAnimatedNowTimestampFunction(facebook::react::TimePointFunction nowFunction); void facebook::react::handleJSError(facebook::jsi::Runtime& runtime, const facebook::jsi::JSError& error, bool isFatal); +void facebook::react::hashAndroidBaseTextPaintAttributes(size_t& seed, const facebook::react::AttributedString& attributedString); void facebook::react::parseProcessedBackgroundImage(const facebook::react::PropsParserContext& context, const facebook::react::RawValue& value, std::vector& result); void facebook::react::parseProcessedFontVariant(const facebook::react::PropsParserContext&, const facebook::react::RawValue& value, facebook::react::FontVariant& result); void facebook::react::parseUnprocessedBackgroundImageList(const facebook::react::PropsParserContext& context, const std::vector& value, std::vector& result); @@ -2621,6 +2625,7 @@ struct facebook::react::LayoutableShadowNode::LayoutInspectingPolicy { } class facebook::react::LineMeasureCacheKey { + public bool includeBaseTextAttributes; public facebook::react::AttributedString attributedString; public facebook::react::ParagraphAttributes paragraphAttributes; public facebook::react::Size size; @@ -4044,6 +4049,7 @@ class facebook::react::TextLayoutManager::PreparedTextLayout { } class facebook::react::TextMeasureCacheKey { + public bool includeBaseTextAttributes; public facebook::react::AttributedString attributedString; public facebook::react::Float pointScaleFactor; public facebook::react::LayoutConstraints layoutConstraints; diff --git a/scripts/cxx-api/api-snapshots/ReactAppleFrameworksCxx.api b/scripts/cxx-api/api-snapshots/ReactAppleFrameworksCxx.api index b99068078b5b..7f241030127d 100644 --- a/scripts/cxx-api/api-snapshots/ReactAppleFrameworksCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAppleFrameworksCxx.api @@ -3472,6 +3472,7 @@ NSArray* facebook::react::extractKeysFromFollyDynamic(const folly::dy NSError* facebook::react::tryAndReturnError(const std::function& func); NSString* facebook::react::deriveSourceURL(NSURL* url); YGDirection facebook::react::yogaDirectionFromLayoutDirection(facebook::react::LayoutDirection direction); +auto facebook::react::androidBaseTextPaintAttributes(const facebook::react::AttributedString& attributedString); bool facebook::react::areAttributedStringFragmentsEquivalentDisplayWise(const facebook::react::AttributedString::Fragment& lhs, const facebook::react::AttributedString::Fragment& rhs); bool facebook::react::areAttributedStringFragmentsEquivalentLayoutWise(const facebook::react::AttributedString::Fragment& lhs, const facebook::react::AttributedString::Fragment& rhs); bool facebook::react::areAttributedStringsEquivalentDisplayWise(const facebook::react::AttributedString& lhs, const facebook::react::AttributedString& rhs); @@ -3534,7 +3535,7 @@ int facebook::react::toInt(const facebook::react::LayoutDirection& layoutDirecti size_t facebook::react::attributedStringFragmentHashDisplayWise(const facebook::react::AttributedString::Fragment& fragment); size_t facebook::react::attributedStringFragmentHashLayoutWise(const facebook::react::AttributedString::Fragment& fragment); size_t facebook::react::attributedStringHashDisplayWise(const facebook::react::AttributedString& attributedString); -size_t facebook::react::attributedStringHashLayoutWise(const facebook::react::AttributedString& attributedString); +size_t facebook::react::attributedStringHashLayoutWise(const facebook::react::AttributedString& attributedString, bool includeBaseTextAttributes); size_t facebook::react::textAttributesHashLayoutWise(const facebook::react::TextAttributes& textAttributes); std::optional facebook::react::blendModeFromString(std::string_view blendModeName); std::optional facebook::react::filterTypeFromString(std::string_view filterName); @@ -4814,6 +4815,7 @@ struct facebook::react::LayoutableShadowNode::LayoutInspectingPolicy { } class facebook::react::LineMeasureCacheKey { + public bool includeBaseTextAttributes; public facebook::react::AttributedString attributedString; public facebook::react::ParagraphAttributes paragraphAttributes; public facebook::react::Size size; @@ -6220,6 +6222,7 @@ class facebook::react::TextLayoutManager { } class facebook::react::TextMeasureCacheKey { + public bool includeBaseTextAttributes; public facebook::react::AttributedString attributedString; public facebook::react::Float pointScaleFactor; public facebook::react::LayoutConstraints layoutConstraints; diff --git a/scripts/cxx-api/api-snapshots/ReactCommonFrameworksCxx.api b/scripts/cxx-api/api-snapshots/ReactCommonFrameworksCxx.api index f5bab50c02f9..6b71ee79aa35 100644 --- a/scripts/cxx-api/api-snapshots/ReactCommonFrameworksCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactCommonFrameworksCxx.api @@ -303,6 +303,7 @@ concept facebook::react::TextLayoutManagerWithPreparedTextLayout = requires( Float facebook::react::floatFromYogaFloat(float value); Float facebook::react::floatFromYogaOptionalFloat(facebook::yoga::FloatOptional value); YGDirection facebook::react::yogaDirectionFromLayoutDirection(facebook::react::LayoutDirection direction); +auto facebook::react::androidBaseTextPaintAttributes(const facebook::react::AttributedString& attributedString); bool facebook::react::areAttributedStringFragmentsEquivalentDisplayWise(const facebook::react::AttributedString::Fragment& lhs, const facebook::react::AttributedString::Fragment& rhs); bool facebook::react::areAttributedStringFragmentsEquivalentLayoutWise(const facebook::react::AttributedString::Fragment& lhs, const facebook::react::AttributedString::Fragment& rhs); bool facebook::react::areAttributedStringsEquivalentDisplayWise(const facebook::react::AttributedString& lhs, const facebook::react::AttributedString& rhs); @@ -352,7 +353,7 @@ int facebook::react::toInt(const facebook::react::LayoutDirection& layoutDirecti size_t facebook::react::attributedStringFragmentHashDisplayWise(const facebook::react::AttributedString::Fragment& fragment); size_t facebook::react::attributedStringFragmentHashLayoutWise(const facebook::react::AttributedString::Fragment& fragment); size_t facebook::react::attributedStringHashDisplayWise(const facebook::react::AttributedString& attributedString); -size_t facebook::react::attributedStringHashLayoutWise(const facebook::react::AttributedString& attributedString); +size_t facebook::react::attributedStringHashLayoutWise(const facebook::react::AttributedString& attributedString, bool includeBaseTextAttributes); size_t facebook::react::textAttributesHashLayoutWise(const facebook::react::TextAttributes& textAttributes); std::optional facebook::react::optionalFloatFromYogaValue(const facebook::yoga::Style::Length& length, std::optional base = {}); std::optional facebook::react::blendModeFromString(std::string_view blendModeName); @@ -419,6 +420,8 @@ template facebook::react::ComponentDescriptorProvider facebook::react::concreteComponentDescriptorProvider(); template DestinationTimePointT facebook::react::clockCast(SourceTimePointT timePoint); +template +bool facebook::react::areAndroidBaseTextPaintAttributesEquivalent(const Key& lhs, const Key& rhs); template T facebook::react::convertRawProp(const facebook::react::PropsParserContext& context, const facebook::react::RawProps& rawProps, const char* name, const T& sourceValue, const U& defaultValue); template @@ -519,6 +522,7 @@ void facebook::react::fromRawValueShared(const facebook::react::ContextContainer void facebook::react::fromString(const std::string& string, facebook::react::AccessibilityTraits& result); void facebook::react::g_setNativeAnimatedNowTimestampFunction(facebook::react::TimePointFunction nowFunction); void facebook::react::handleJSError(facebook::jsi::Runtime& runtime, const facebook::jsi::JSError& error, bool isFatal); +void facebook::react::hashAndroidBaseTextPaintAttributes(size_t& seed, const facebook::react::AttributedString& attributedString); void facebook::react::parseProcessedBackgroundImage(const facebook::react::PropsParserContext& context, const facebook::react::RawValue& value, std::vector& result); void facebook::react::parseProcessedFontVariant(const facebook::react::PropsParserContext&, const facebook::react::RawValue& value, facebook::react::FontVariant& result); void facebook::react::parseUnprocessedBackgroundImageList(const facebook::react::PropsParserContext& context, const std::vector& value, std::vector& result); @@ -1542,6 +1546,7 @@ struct facebook::react::LayoutableShadowNode::LayoutInspectingPolicy { } class facebook::react::LineMeasureCacheKey { + public bool includeBaseTextAttributes; public facebook::react::AttributedString attributedString; public facebook::react::ParagraphAttributes paragraphAttributes; public facebook::react::Size size; @@ -2546,6 +2551,7 @@ class facebook::react::TextLayoutLinesProvider { class facebook::react::TextMeasureCacheKey { public Float pointScaleFactor; + public bool includeBaseTextAttributes; public facebook::react::AttributedString attributedString; public facebook::react::LayoutConstraints layoutConstraints; public facebook::react::ParagraphAttributes paragraphAttributes;