diff --git a/example/android/build.gradle b/example/android/build.gradle
index dad99b0..08d3659 100644
--- a/example/android/build.gradle
+++ b/example/android/build.gradle
@@ -1,7 +1,7 @@
buildscript {
ext {
buildToolsVersion = "36.0.0"
- minSdkVersion = 24
+ minSdkVersion = 29
compileSdkVersion = 36
targetSdkVersion = 36
ndkVersion = "27.1.12297006"
diff --git a/example/src/screens/HtmlScreen.tsx b/example/src/screens/HtmlScreen.tsx
index 69ba2a6..3f6f627 100644
--- a/example/src/screens/HtmlScreen.tsx
+++ b/example/src/screens/HtmlScreen.tsx
@@ -107,9 +107,12 @@ export function HtmlScreen() {
Green bold text from inline style
Custom font size and line height
-Centered text
-uppercase text
-Purple underline
`}
+
+
Centered text
+
uppercase text
+
Purple underline
+
+`}
diff --git a/example/src/screens/PlainTextScreen.tsx b/example/src/screens/PlainTextScreen.tsx
index 55e0943..c2f02a9 100644
--- a/example/src/screens/PlainTextScreen.tsx
+++ b/example/src/screens/PlainTextScreen.tsx
@@ -1,5 +1,5 @@
-import React, { useMemo } from 'react';
-import { ScrollView, StyleSheet, Text, View } from 'react-native';
+import React, { useLayoutEffect, useMemo } from 'react';
+import { ScrollView, StatusBar, Text, View } from 'react-native';
import { NitroText } from 'react-native-nitro-text';
import { styles } from './styles';
import { NitroModules } from 'react-native-nitro-modules';
@@ -13,6 +13,10 @@ export function PlainTextScreen() {
[],
);
+ useLayoutEffect(() => {
+ StatusBar.setBarStyle('dark-content');
+ }, []);
+
return (
{/* Header Section */}
@@ -30,12 +34,15 @@ export function PlainTextScreen() {
High-performance selectable text with native rendering
+
+ High-performance selectable text with native rendering
+
{/* Basic Usage */}
Basic Usage
-
+
This is a simple NitroText component with native performance. Try
selecting this text to see the smooth selection behavior!
@@ -44,7 +51,7 @@ export function PlainTextScreen() {
{/* Nested NitroText wth numberOfLines (does not work currently it only renders the first line nested text doesn't render) */}
- Nested NitroText with numberOfLines
+ Nested NitroText with numberOfLines (NitroText)
This is a simple NitroText component with native performance.{' '}
@@ -53,6 +60,17 @@ export function PlainTextScreen() {
+
+
+ Nested NitroText with numberOfLines (RN Text)
+
+
+ This is a simple NitroText component with native performance.{' '}
+
+ Try selecting this text to see the smooth selection behavior!
+
+
+
{/* Rich Text Formatting */}
@@ -100,14 +118,14 @@ export function PlainTextScreen() {
NitroText can seamlessly integrate with React Native's Text component:
{'\n\n'}
- This is a React Native Text component{' '}
- with nested NitroText{' '}
+ This is a React Native Text component
+ with nested NitroText
inside it.
{'\n\n'}And vice versa - NitroText can contain:{'\n'}
- Regular text with{' '}
- RN Text nested inside{' '}
+ Regular text with
+ RN Text nested inside{' '}
NitroText.
diff --git a/ios/NitroTextImpl.swift b/ios/NitroTextImpl.swift
index ffa7844..6cd48e9 100644
--- a/ios/NitroTextImpl.swift
+++ b/ios/NitroTextImpl.swift
@@ -441,6 +441,6 @@ extension NitroTextImpl {
a.textDecorationStyle == b.textDecorationStyle &&
a.fragmentBackgroundColor == b.fragmentBackgroundColor &&
a.selectionColor == b.selectionColor &&
- a.linkUrl == b.linkUrl // Important: links must match for fragments to be identical
+ a.linkUrl == b.linkUrl
}
}
diff --git a/nitro.json b/nitro.json
index 34222e1..8ce4525 100644
--- a/nitro.json
+++ b/nitro.json
@@ -14,7 +14,8 @@
},
"autolinking": {
"NitroText": {
- "swift": "HybridNitroText"
+ "swift": "HybridNitroText",
+ "kotlin": "HybridNitroText"
}
},
"ignorePaths": [
diff --git a/nitrogen/generated/android/NitroText+autolinking.cmake b/nitrogen/generated/android/NitroText+autolinking.cmake
new file mode 100644
index 0000000..f9f7c17
--- /dev/null
+++ b/nitrogen/generated/android/NitroText+autolinking.cmake
@@ -0,0 +1,83 @@
+#
+# NitroText+autolinking.cmake
+# This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
+# https://github.com/mrousavy/nitro
+# Copyright © 2025 Marc Rousavy @ Margelo
+#
+
+# This is a CMake file that adds all files generated by Nitrogen
+# to the current CMake project.
+#
+# To use it, add this to your CMakeLists.txt:
+# ```cmake
+# include(${CMAKE_SOURCE_DIR}/../nitrogen/generated/android/NitroText+autolinking.cmake)
+# ```
+
+# Define a flag to check if we are building properly
+add_definitions(-DBUILDING_NITROTEXT_WITH_GENERATED_CMAKE_PROJECT)
+
+# Enable Raw Props parsing in react-native (for Nitro Views)
+add_definitions(-DRN_SERIALIZABLE_STATE)
+
+# Add all headers that were generated by Nitrogen
+include_directories(
+ "../nitrogen/generated/shared/c++"
+ "../nitrogen/generated/android/c++"
+ "../nitrogen/generated/android/"
+)
+
+# Add all .cpp sources that were generated by Nitrogen
+target_sources(
+ # CMake project name (Android C++ library name)
+ NitroText PRIVATE
+ # Autolinking Setup
+ ../nitrogen/generated/android/NitroTextOnLoad.cpp
+ # Shared Nitrogen C++ sources
+ ../nitrogen/generated/shared/c++/HybridNitroTextSpec.cpp
+ ../nitrogen/generated/shared/c++/views/HybridNitroTextComponent.cpp
+ # Android-specific Nitrogen C++ sources
+ ../nitrogen/generated/android/c++/JHybridNitroTextSpec.cpp
+ ../nitrogen/generated/android/c++/views/JHybridNitroTextStateUpdater.cpp
+)
+
+# From node_modules/react-native/ReactAndroid/cmake-utils/folly-flags.cmake
+# Used in node_modules/react-native/ReactAndroid/cmake-utils/ReactNative-application.cmake
+target_compile_definitions(
+ NitroText PRIVATE
+ -DFOLLY_NO_CONFIG=1
+ -DFOLLY_HAVE_CLOCK_GETTIME=1
+ -DFOLLY_USE_LIBCPP=1
+ -DFOLLY_CFG_NO_COROUTINES=1
+ -DFOLLY_MOBILE=1
+ -DFOLLY_HAVE_RECVMMSG=1
+ -DFOLLY_HAVE_PTHREAD=1
+ # Once we target android-23 above, we can comment
+ # the following line. NDK uses GNU style stderror_r() after API 23.
+ -DFOLLY_HAVE_XSI_STRERROR_R=1
+)
+
+# Add all libraries required by the generated specs
+find_package(fbjni REQUIRED) # <-- Used for communication between Java <-> C++
+find_package(ReactAndroid REQUIRED) # <-- Used to set up React Native bindings (e.g. CallInvoker/TurboModule)
+find_package(react-native-nitro-modules REQUIRED) # <-- Used to create all HybridObjects and use the Nitro core library
+
+# Link all libraries together
+target_link_libraries(
+ NitroText
+ fbjni::fbjni # <-- Facebook C++ JNI helpers
+ ReactAndroid::jsi # <-- RN: JSI
+ react-native-nitro-modules::NitroModules # <-- NitroModules Core :)
+)
+
+# Link react-native (different prefab between RN 0.75 and RN 0.76)
+if(ReactAndroid_VERSION_MINOR GREATER_EQUAL 76)
+ target_link_libraries(
+ NitroText
+ ReactAndroid::reactnative # <-- RN: Native Modules umbrella prefab
+ )
+else()
+ target_link_libraries(
+ NitroText
+ ReactAndroid::react_nativemodule_core # <-- RN: TurboModules Core
+ )
+endif()
diff --git a/nitrogen/generated/android/NitroText+autolinking.gradle b/nitrogen/generated/android/NitroText+autolinking.gradle
new file mode 100644
index 0000000..3ad0a33
--- /dev/null
+++ b/nitrogen/generated/android/NitroText+autolinking.gradle
@@ -0,0 +1,27 @@
+///
+/// NitroText+autolinking.gradle
+/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
+/// https://github.com/mrousavy/nitro
+/// Copyright © 2025 Marc Rousavy @ Margelo
+///
+
+/// This is a Gradle file that adds all files generated by Nitrogen
+/// to the current Gradle project.
+///
+/// To use it, add this to your build.gradle:
+/// ```gradle
+/// apply from: '../nitrogen/generated/android/NitroText+autolinking.gradle'
+/// ```
+
+logger.warn("[NitroModules] 🔥 NitroText is boosted by nitro!")
+
+android {
+ sourceSets {
+ main {
+ java.srcDirs += [
+ // Nitrogen files
+ "${project.projectDir}/../nitrogen/generated/android/kotlin"
+ ]
+ }
+ }
+}
diff --git a/nitrogen/generated/android/NitroTextOnLoad.cpp b/nitrogen/generated/android/NitroTextOnLoad.cpp
new file mode 100644
index 0000000..9290e23
--- /dev/null
+++ b/nitrogen/generated/android/NitroTextOnLoad.cpp
@@ -0,0 +1,50 @@
+///
+/// NitroTextOnLoad.cpp
+/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
+/// https://github.com/mrousavy/nitro
+/// Copyright © 2025 Marc Rousavy @ Margelo
+///
+
+#ifndef BUILDING_NITROTEXT_WITH_GENERATED_CMAKE_PROJECT
+#error NitroTextOnLoad.cpp is not being built with the autogenerated CMakeLists.txt project. Is a different CMakeLists.txt building this?
+#endif
+
+#include "NitroTextOnLoad.hpp"
+
+#include
+#include
+#include
+
+#include "JHybridNitroTextSpec.hpp"
+#include "JFunc_void.hpp"
+#include "JFunc_void_TextLayoutEvent.hpp"
+#include "views/JHybridNitroTextStateUpdater.hpp"
+#include
+
+namespace margelo::nitro::nitrotext {
+
+int initialize(JavaVM* vm) {
+ using namespace margelo::nitro;
+ using namespace margelo::nitro::nitrotext;
+ using namespace facebook;
+
+ return facebook::jni::initialize(vm, [] {
+ // Register native JNI methods
+ margelo::nitro::nitrotext::JHybridNitroTextSpec::registerNatives();
+ margelo::nitro::nitrotext::JFunc_void_cxx::registerNatives();
+ margelo::nitro::nitrotext::JFunc_void_TextLayoutEvent_cxx::registerNatives();
+ margelo::nitro::nitrotext::views::JHybridNitroTextStateUpdater::registerNatives();
+
+ // Register Nitro Hybrid Objects
+ HybridObjectRegistry::registerHybridObjectConstructor(
+ "NitroText",
+ []() -> std::shared_ptr {
+ static DefaultConstructableObject object("com/margelo/nitro/nitrotext/HybridNitroText");
+ auto instance = object.create();
+ return instance->cthis()->shared();
+ }
+ );
+ });
+}
+
+} // namespace margelo::nitro::nitrotext
diff --git a/nitrogen/generated/android/NitroTextOnLoad.hpp b/nitrogen/generated/android/NitroTextOnLoad.hpp
new file mode 100644
index 0000000..762bf60
--- /dev/null
+++ b/nitrogen/generated/android/NitroTextOnLoad.hpp
@@ -0,0 +1,25 @@
+///
+/// NitroTextOnLoad.hpp
+/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
+/// https://github.com/mrousavy/nitro
+/// Copyright © 2025 Marc Rousavy @ Margelo
+///
+
+#include
+#include
+
+namespace margelo::nitro::nitrotext {
+
+ /**
+ * Initializes the native (C++) part of NitroText, and autolinks all Hybrid Objects.
+ * Call this in your `JNI_OnLoad` function (probably inside `cpp-adapter.cpp`).
+ * Example:
+ * ```cpp (cpp-adapter.cpp)
+ * JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void*) {
+ * return margelo::nitro::nitrotext::initialize(vm);
+ * }
+ * ```
+ */
+ int initialize(JavaVM* vm);
+
+} // namespace margelo::nitro::nitrotext
diff --git a/nitrogen/generated/android/c++/JDynamicTypeRamp.hpp b/nitrogen/generated/android/c++/JDynamicTypeRamp.hpp
new file mode 100644
index 0000000..abbf037
--- /dev/null
+++ b/nitrogen/generated/android/c++/JDynamicTypeRamp.hpp
@@ -0,0 +1,86 @@
+///
+/// JDynamicTypeRamp.hpp
+/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
+/// https://github.com/mrousavy/nitro
+/// Copyright © 2025 Marc Rousavy @ Margelo
+///
+
+#pragma once
+
+#include
+#include "DynamicTypeRamp.hpp"
+
+namespace margelo::nitro::nitrotext {
+
+ using namespace facebook;
+
+ /**
+ * The C++ JNI bridge between the C++ enum "DynamicTypeRamp" and the the Kotlin enum "DynamicTypeRamp".
+ */
+ struct JDynamicTypeRamp final: public jni::JavaClass {
+ public:
+ static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/nitrotext/DynamicTypeRamp;";
+
+ public:
+ /**
+ * Convert this Java/Kotlin-based enum to the C++ enum DynamicTypeRamp.
+ */
+ [[maybe_unused]]
+ [[nodiscard]]
+ DynamicTypeRamp toCpp() const {
+ static const auto clazz = javaClassStatic();
+ static const auto fieldOrdinal = clazz->getField("value");
+ int ordinal = this->getFieldValue(fieldOrdinal);
+ return static_cast(ordinal);
+ }
+
+ public:
+ /**
+ * Create a Java/Kotlin-based enum with the given C++ enum's value.
+ */
+ [[maybe_unused]]
+ static jni::alias_ref fromCpp(DynamicTypeRamp value) {
+ static const auto clazz = javaClassStatic();
+ static const auto fieldCAPTION2 = clazz->getStaticField("CAPTION2");
+ static const auto fieldCAPTION1 = clazz->getStaticField("CAPTION1");
+ static const auto fieldFOOTNOTE = clazz->getStaticField("FOOTNOTE");
+ static const auto fieldSUBHEADLINE = clazz->getStaticField("SUBHEADLINE");
+ static const auto fieldCALLOUT = clazz->getStaticField("CALLOUT");
+ static const auto fieldBODY = clazz->getStaticField("BODY");
+ static const auto fieldHEADLINE = clazz->getStaticField("HEADLINE");
+ static const auto fieldTITLE3 = clazz->getStaticField("TITLE3");
+ static const auto fieldTITLE2 = clazz->getStaticField("TITLE2");
+ static const auto fieldTITLE1 = clazz->getStaticField("TITLE1");
+ static const auto fieldLARGETITLE = clazz->getStaticField("LARGETITLE");
+
+ switch (value) {
+ case DynamicTypeRamp::CAPTION2:
+ return clazz->getStaticFieldValue(fieldCAPTION2);
+ case DynamicTypeRamp::CAPTION1:
+ return clazz->getStaticFieldValue(fieldCAPTION1);
+ case DynamicTypeRamp::FOOTNOTE:
+ return clazz->getStaticFieldValue(fieldFOOTNOTE);
+ case DynamicTypeRamp::SUBHEADLINE:
+ return clazz->getStaticFieldValue(fieldSUBHEADLINE);
+ case DynamicTypeRamp::CALLOUT:
+ return clazz->getStaticFieldValue(fieldCALLOUT);
+ case DynamicTypeRamp::BODY:
+ return clazz->getStaticFieldValue(fieldBODY);
+ case DynamicTypeRamp::HEADLINE:
+ return clazz->getStaticFieldValue(fieldHEADLINE);
+ case DynamicTypeRamp::TITLE3:
+ return clazz->getStaticFieldValue(fieldTITLE3);
+ case DynamicTypeRamp::TITLE2:
+ return clazz->getStaticFieldValue(fieldTITLE2);
+ case DynamicTypeRamp::TITLE1:
+ return clazz->getStaticFieldValue(fieldTITLE1);
+ case DynamicTypeRamp::LARGETITLE:
+ return clazz->getStaticFieldValue(fieldLARGETITLE);
+ default:
+ std::string stringValue = std::to_string(static_cast(value));
+ throw std::invalid_argument("Invalid enum value (" + stringValue + "!");
+ }
+ }
+ };
+
+} // namespace margelo::nitro::nitrotext
diff --git a/nitrogen/generated/android/c++/JEllipsizeMode.hpp b/nitrogen/generated/android/c++/JEllipsizeMode.hpp
new file mode 100644
index 0000000..91ad21c
--- /dev/null
+++ b/nitrogen/generated/android/c++/JEllipsizeMode.hpp
@@ -0,0 +1,65 @@
+///
+/// JEllipsizeMode.hpp
+/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
+/// https://github.com/mrousavy/nitro
+/// Copyright © 2025 Marc Rousavy @ Margelo
+///
+
+#pragma once
+
+#include
+#include "EllipsizeMode.hpp"
+
+namespace margelo::nitro::nitrotext {
+
+ using namespace facebook;
+
+ /**
+ * The C++ JNI bridge between the C++ enum "EllipsizeMode" and the the Kotlin enum "EllipsizeMode".
+ */
+ struct JEllipsizeMode final: public jni::JavaClass {
+ public:
+ static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/nitrotext/EllipsizeMode;";
+
+ public:
+ /**
+ * Convert this Java/Kotlin-based enum to the C++ enum EllipsizeMode.
+ */
+ [[maybe_unused]]
+ [[nodiscard]]
+ EllipsizeMode toCpp() const {
+ static const auto clazz = javaClassStatic();
+ static const auto fieldOrdinal = clazz->getField("value");
+ int ordinal = this->getFieldValue(fieldOrdinal);
+ return static_cast(ordinal);
+ }
+
+ public:
+ /**
+ * Create a Java/Kotlin-based enum with the given C++ enum's value.
+ */
+ [[maybe_unused]]
+ static jni::alias_ref fromCpp(EllipsizeMode value) {
+ static const auto clazz = javaClassStatic();
+ static const auto fieldHEAD = clazz->getStaticField("HEAD");
+ static const auto fieldMIDDLE = clazz->getStaticField("MIDDLE");
+ static const auto fieldTAIL = clazz->getStaticField("TAIL");
+ static const auto fieldCLIP = clazz->getStaticField("CLIP");
+
+ switch (value) {
+ case EllipsizeMode::HEAD:
+ return clazz->getStaticFieldValue(fieldHEAD);
+ case EllipsizeMode::MIDDLE:
+ return clazz->getStaticFieldValue(fieldMIDDLE);
+ case EllipsizeMode::TAIL:
+ return clazz->getStaticFieldValue(fieldTAIL);
+ case EllipsizeMode::CLIP:
+ return clazz->getStaticFieldValue(fieldCLIP);
+ default:
+ std::string stringValue = std::to_string(static_cast(value));
+ throw std::invalid_argument("Invalid enum value (" + stringValue + "!");
+ }
+ }
+ };
+
+} // namespace margelo::nitro::nitrotext
diff --git a/nitrogen/generated/android/c++/JFontStyle.hpp b/nitrogen/generated/android/c++/JFontStyle.hpp
new file mode 100644
index 0000000..5d4a27f
--- /dev/null
+++ b/nitrogen/generated/android/c++/JFontStyle.hpp
@@ -0,0 +1,62 @@
+///
+/// JFontStyle.hpp
+/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
+/// https://github.com/mrousavy/nitro
+/// Copyright © 2025 Marc Rousavy @ Margelo
+///
+
+#pragma once
+
+#include
+#include "FontStyle.hpp"
+
+namespace margelo::nitro::nitrotext {
+
+ using namespace facebook;
+
+ /**
+ * The C++ JNI bridge between the C++ enum "FontStyle" and the the Kotlin enum "FontStyle".
+ */
+ struct JFontStyle final: public jni::JavaClass {
+ public:
+ static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/nitrotext/FontStyle;";
+
+ public:
+ /**
+ * Convert this Java/Kotlin-based enum to the C++ enum FontStyle.
+ */
+ [[maybe_unused]]
+ [[nodiscard]]
+ FontStyle toCpp() const {
+ static const auto clazz = javaClassStatic();
+ static const auto fieldOrdinal = clazz->getField("value");
+ int ordinal = this->getFieldValue(fieldOrdinal);
+ return static_cast(ordinal);
+ }
+
+ public:
+ /**
+ * Create a Java/Kotlin-based enum with the given C++ enum's value.
+ */
+ [[maybe_unused]]
+ static jni::alias_ref fromCpp(FontStyle value) {
+ static const auto clazz = javaClassStatic();
+ static const auto fieldNORMAL = clazz->getStaticField("NORMAL");
+ static const auto fieldITALIC = clazz->getStaticField("ITALIC");
+ static const auto fieldOBLIQUE = clazz->getStaticField("OBLIQUE");
+
+ switch (value) {
+ case FontStyle::NORMAL:
+ return clazz->getStaticFieldValue(fieldNORMAL);
+ case FontStyle::ITALIC:
+ return clazz->getStaticFieldValue(fieldITALIC);
+ case FontStyle::OBLIQUE:
+ return clazz->getStaticFieldValue(fieldOBLIQUE);
+ default:
+ std::string stringValue = std::to_string(static_cast(value));
+ throw std::invalid_argument("Invalid enum value (" + stringValue + "!");
+ }
+ }
+ };
+
+} // namespace margelo::nitro::nitrotext
diff --git a/nitrogen/generated/android/c++/JFontWeight.hpp b/nitrogen/generated/android/c++/JFontWeight.hpp
new file mode 100644
index 0000000..a8c6440
--- /dev/null
+++ b/nitrogen/generated/android/c++/JFontWeight.hpp
@@ -0,0 +1,89 @@
+///
+/// JFontWeight.hpp
+/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
+/// https://github.com/mrousavy/nitro
+/// Copyright © 2025 Marc Rousavy @ Margelo
+///
+
+#pragma once
+
+#include
+#include "FontWeight.hpp"
+
+namespace margelo::nitro::nitrotext {
+
+ using namespace facebook;
+
+ /**
+ * The C++ JNI bridge between the C++ enum "FontWeight" and the the Kotlin enum "FontWeight".
+ */
+ struct JFontWeight final: public jni::JavaClass {
+ public:
+ static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/nitrotext/FontWeight;";
+
+ public:
+ /**
+ * Convert this Java/Kotlin-based enum to the C++ enum FontWeight.
+ */
+ [[maybe_unused]]
+ [[nodiscard]]
+ FontWeight toCpp() const {
+ static const auto clazz = javaClassStatic();
+ static const auto fieldOrdinal = clazz->getField("value");
+ int ordinal = this->getFieldValue(fieldOrdinal);
+ return static_cast(ordinal);
+ }
+
+ public:
+ /**
+ * Create a Java/Kotlin-based enum with the given C++ enum's value.
+ */
+ [[maybe_unused]]
+ static jni::alias_ref fromCpp(FontWeight value) {
+ static const auto clazz = javaClassStatic();
+ static const auto fieldNORMAL = clazz->getStaticField("NORMAL");
+ static const auto fieldBOLD = clazz->getStaticField("BOLD");
+ static const auto fieldULTRALIGHT = clazz->getStaticField("ULTRALIGHT");
+ static const auto fieldTHIN = clazz->getStaticField("THIN");
+ static const auto fieldLIGHT = clazz->getStaticField("LIGHT");
+ static const auto fieldMEDIUM = clazz->getStaticField("MEDIUM");
+ static const auto fieldREGULAR = clazz->getStaticField("REGULAR");
+ static const auto fieldSEMIBOLD = clazz->getStaticField("SEMIBOLD");
+ static const auto fieldCONDENSEDBOLD = clazz->getStaticField("CONDENSEDBOLD");
+ static const auto fieldCONDENSED = clazz->getStaticField("CONDENSED");
+ static const auto fieldHEAVY = clazz->getStaticField("HEAVY");
+ static const auto fieldBLACK = clazz->getStaticField("BLACK");
+
+ switch (value) {
+ case FontWeight::NORMAL:
+ return clazz->getStaticFieldValue(fieldNORMAL);
+ case FontWeight::BOLD:
+ return clazz->getStaticFieldValue(fieldBOLD);
+ case FontWeight::ULTRALIGHT:
+ return clazz->getStaticFieldValue(fieldULTRALIGHT);
+ case FontWeight::THIN:
+ return clazz->getStaticFieldValue(fieldTHIN);
+ case FontWeight::LIGHT:
+ return clazz->getStaticFieldValue(fieldLIGHT);
+ case FontWeight::MEDIUM:
+ return clazz->getStaticFieldValue(fieldMEDIUM);
+ case FontWeight::REGULAR:
+ return clazz->getStaticFieldValue(fieldREGULAR);
+ case FontWeight::SEMIBOLD:
+ return clazz->getStaticFieldValue(fieldSEMIBOLD);
+ case FontWeight::CONDENSEDBOLD:
+ return clazz->getStaticFieldValue(fieldCONDENSEDBOLD);
+ case FontWeight::CONDENSED:
+ return clazz->getStaticFieldValue(fieldCONDENSED);
+ case FontWeight::HEAVY:
+ return clazz->getStaticFieldValue(fieldHEAVY);
+ case FontWeight::BLACK:
+ return clazz->getStaticFieldValue(fieldBLACK);
+ default:
+ std::string stringValue = std::to_string(static_cast(value));
+ throw std::invalid_argument("Invalid enum value (" + stringValue + "!");
+ }
+ }
+ };
+
+} // namespace margelo::nitro::nitrotext
diff --git a/nitrogen/generated/android/c++/JFragment.hpp b/nitrogen/generated/android/c++/JFragment.hpp
new file mode 100644
index 0000000..b79c6d0
--- /dev/null
+++ b/nitrogen/generated/android/c++/JFragment.hpp
@@ -0,0 +1,130 @@
+///
+/// JFragment.hpp
+/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
+/// https://github.com/mrousavy/nitro
+/// Copyright © 2025 Marc Rousavy @ Margelo
+///
+
+#pragma once
+
+#include
+#include "Fragment.hpp"
+
+#include "FontStyle.hpp"
+#include "FontWeight.hpp"
+#include "JFontStyle.hpp"
+#include "JFontWeight.hpp"
+#include "JTextAlign.hpp"
+#include "JTextDecorationLine.hpp"
+#include "JTextDecorationStyle.hpp"
+#include "JTextTransform.hpp"
+#include "TextAlign.hpp"
+#include "TextDecorationLine.hpp"
+#include "TextDecorationStyle.hpp"
+#include "TextTransform.hpp"
+#include
+#include
+
+namespace margelo::nitro::nitrotext {
+
+ using namespace facebook;
+
+ /**
+ * The C++ JNI bridge between the C++ struct "Fragment" and the the Kotlin data class "Fragment".
+ */
+ struct JFragment final: public jni::JavaClass {
+ public:
+ static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/nitrotext/Fragment;";
+
+ public:
+ /**
+ * Convert this Java/Kotlin-based struct to the C++ struct Fragment by copying all values to C++.
+ */
+ [[maybe_unused]]
+ [[nodiscard]]
+ Fragment toCpp() const {
+ static const auto clazz = javaClassStatic();
+ static const auto fieldText = clazz->getField("text");
+ jni::local_ref text = this->getFieldValue(fieldText);
+ static const auto fieldSelectionColor = clazz->getField("selectionColor");
+ jni::local_ref selectionColor = this->getFieldValue(fieldSelectionColor);
+ static const auto fieldFontSize = clazz->getField("fontSize");
+ jni::local_ref fontSize = this->getFieldValue(fieldFontSize);
+ static const auto fieldFontWeight = clazz->getField("fontWeight");
+ jni::local_ref fontWeight = this->getFieldValue(fieldFontWeight);
+ static const auto fieldFontColor = clazz->getField("fontColor");
+ jni::local_ref fontColor = this->getFieldValue(fieldFontColor);
+ static const auto fieldFragmentBackgroundColor = clazz->getField("fragmentBackgroundColor");
+ jni::local_ref fragmentBackgroundColor = this->getFieldValue(fieldFragmentBackgroundColor);
+ static const auto fieldFontStyle = clazz->getField("fontStyle");
+ jni::local_ref fontStyle = this->getFieldValue(fieldFontStyle);
+ static const auto fieldFontFamily = clazz->getField("fontFamily");
+ jni::local_ref fontFamily = this->getFieldValue(fieldFontFamily);
+ static const auto fieldLineHeight = clazz->getField("lineHeight");
+ jni::local_ref lineHeight = this->getFieldValue(fieldLineHeight);
+ static const auto fieldLetterSpacing = clazz->getField("letterSpacing");
+ jni::local_ref letterSpacing = this->getFieldValue(fieldLetterSpacing);
+ static const auto fieldTextAlign = clazz->getField("textAlign");
+ jni::local_ref textAlign = this->getFieldValue(fieldTextAlign);
+ static const auto fieldTextTransform = clazz->getField("textTransform");
+ jni::local_ref textTransform = this->getFieldValue(fieldTextTransform);
+ static const auto fieldTextDecorationLine = clazz->getField("textDecorationLine");
+ jni::local_ref textDecorationLine = this->getFieldValue(fieldTextDecorationLine);
+ static const auto fieldTextDecorationColor = clazz->getField("textDecorationColor");
+ jni::local_ref textDecorationColor = this->getFieldValue(fieldTextDecorationColor);
+ static const auto fieldTextDecorationStyle = clazz->getField("textDecorationStyle");
+ jni::local_ref textDecorationStyle = this->getFieldValue(fieldTextDecorationStyle);
+ static const auto fieldLinkUrl = clazz->getField("linkUrl");
+ jni::local_ref linkUrl = this->getFieldValue(fieldLinkUrl);
+ return Fragment(
+ text != nullptr ? std::make_optional(text->toStdString()) : std::nullopt,
+ selectionColor != nullptr ? std::make_optional(selectionColor->toStdString()) : std::nullopt,
+ fontSize != nullptr ? std::make_optional(fontSize->value()) : std::nullopt,
+ fontWeight != nullptr ? std::make_optional(fontWeight->toCpp()) : std::nullopt,
+ fontColor != nullptr ? std::make_optional(fontColor->toStdString()) : std::nullopt,
+ fragmentBackgroundColor != nullptr ? std::make_optional(fragmentBackgroundColor->toStdString()) : std::nullopt,
+ fontStyle != nullptr ? std::make_optional(fontStyle->toCpp()) : std::nullopt,
+ fontFamily != nullptr ? std::make_optional(fontFamily->toStdString()) : std::nullopt,
+ lineHeight != nullptr ? std::make_optional(lineHeight->value()) : std::nullopt,
+ letterSpacing != nullptr ? std::make_optional(letterSpacing->value()) : std::nullopt,
+ textAlign != nullptr ? std::make_optional(textAlign->toCpp()) : std::nullopt,
+ textTransform != nullptr ? std::make_optional(textTransform->toCpp()) : std::nullopt,
+ textDecorationLine != nullptr ? std::make_optional(textDecorationLine->toCpp()) : std::nullopt,
+ textDecorationColor != nullptr ? std::make_optional(textDecorationColor->toStdString()) : std::nullopt,
+ textDecorationStyle != nullptr ? std::make_optional(textDecorationStyle->toCpp()) : std::nullopt,
+ linkUrl != nullptr ? std::make_optional(linkUrl->toStdString()) : std::nullopt
+ );
+ }
+
+ public:
+ /**
+ * Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
+ */
+ [[maybe_unused]]
+ static jni::local_ref fromCpp(const Fragment& value) {
+ using JSignature = JFragment(jni::alias_ref, jni::alias_ref, jni::alias_ref, jni::alias_ref, jni::alias_ref, jni::alias_ref, jni::alias_ref, jni::alias_ref, jni::alias_ref, jni::alias_ref, jni::alias_ref, jni::alias_ref, jni::alias_ref, jni::alias_ref, jni::alias_ref, jni::alias_ref);
+ static const auto clazz = javaClassStatic();
+ static const auto create = clazz->getStaticMethod("fromCpp");
+ return create(
+ clazz,
+ value.text.has_value() ? jni::make_jstring(value.text.value()) : nullptr,
+ value.selectionColor.has_value() ? jni::make_jstring(value.selectionColor.value()) : nullptr,
+ value.fontSize.has_value() ? jni::JDouble::valueOf(value.fontSize.value()) : nullptr,
+ value.fontWeight.has_value() ? JFontWeight::fromCpp(value.fontWeight.value()) : nullptr,
+ value.fontColor.has_value() ? jni::make_jstring(value.fontColor.value()) : nullptr,
+ value.fragmentBackgroundColor.has_value() ? jni::make_jstring(value.fragmentBackgroundColor.value()) : nullptr,
+ value.fontStyle.has_value() ? JFontStyle::fromCpp(value.fontStyle.value()) : nullptr,
+ value.fontFamily.has_value() ? jni::make_jstring(value.fontFamily.value()) : nullptr,
+ value.lineHeight.has_value() ? jni::JDouble::valueOf(value.lineHeight.value()) : nullptr,
+ value.letterSpacing.has_value() ? jni::JDouble::valueOf(value.letterSpacing.value()) : nullptr,
+ value.textAlign.has_value() ? JTextAlign::fromCpp(value.textAlign.value()) : nullptr,
+ value.textTransform.has_value() ? JTextTransform::fromCpp(value.textTransform.value()) : nullptr,
+ value.textDecorationLine.has_value() ? JTextDecorationLine::fromCpp(value.textDecorationLine.value()) : nullptr,
+ value.textDecorationColor.has_value() ? jni::make_jstring(value.textDecorationColor.value()) : nullptr,
+ value.textDecorationStyle.has_value() ? JTextDecorationStyle::fromCpp(value.textDecorationStyle.value()) : nullptr,
+ value.linkUrl.has_value() ? jni::make_jstring(value.linkUrl.value()) : nullptr
+ );
+ }
+ };
+
+} // namespace margelo::nitro::nitrotext
diff --git a/nitrogen/generated/android/c++/JFunc_void.hpp b/nitrogen/generated/android/c++/JFunc_void.hpp
new file mode 100644
index 0000000..f1b7802
--- /dev/null
+++ b/nitrogen/generated/android/c++/JFunc_void.hpp
@@ -0,0 +1,75 @@
+///
+/// JFunc_void.hpp
+/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
+/// https://github.com/mrousavy/nitro
+/// Copyright © 2025 Marc Rousavy @ Margelo
+///
+
+#pragma once
+
+#include
+#include
+
+#include
+#include
+
+namespace margelo::nitro::nitrotext {
+
+ using namespace facebook;
+
+ /**
+ * Represents the Java/Kotlin callback `() -> Unit`.
+ * This can be passed around between C++ and Java/Kotlin.
+ */
+ struct JFunc_void: public jni::JavaClass {
+ public:
+ static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/nitrotext/Func_void;";
+
+ public:
+ /**
+ * Invokes the function this `JFunc_void` instance holds through JNI.
+ */
+ void invoke() const {
+ static const auto method = javaClassStatic()->getMethod("invoke");
+ method(self());
+ }
+ };
+
+ /**
+ * An implementation of Func_void that is backed by a C++ implementation (using `std::function<...>`)
+ */
+ class JFunc_void_cxx final: public jni::HybridClass {
+ public:
+ static jni::local_ref fromCpp(const std::function& func) {
+ return JFunc_void_cxx::newObjectCxxArgs(func);
+ }
+
+ public:
+ /**
+ * Invokes the C++ `std::function<...>` this `JFunc_void_cxx` instance holds.
+ */
+ void invoke_cxx() {
+ _func();
+ }
+
+ public:
+ [[nodiscard]]
+ inline const std::function& getFunction() const {
+ return _func;
+ }
+
+ public:
+ static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/nitrotext/Func_void_cxx;";
+ static void registerNatives() {
+ registerHybrid({makeNativeMethod("invoke_cxx", JFunc_void_cxx::invoke_cxx)});
+ }
+
+ private:
+ explicit JFunc_void_cxx(const std::function& func): _func(func) { }
+
+ private:
+ friend HybridBase;
+ std::function _func;
+ };
+
+} // namespace margelo::nitro::nitrotext
diff --git a/nitrogen/generated/android/c++/JFunc_void_TextLayoutEvent.hpp b/nitrogen/generated/android/c++/JFunc_void_TextLayoutEvent.hpp
new file mode 100644
index 0000000..b03ff0c
--- /dev/null
+++ b/nitrogen/generated/android/c++/JFunc_void_TextLayoutEvent.hpp
@@ -0,0 +1,81 @@
+///
+/// JFunc_void_TextLayoutEvent.hpp
+/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
+/// https://github.com/mrousavy/nitro
+/// Copyright © 2025 Marc Rousavy @ Margelo
+///
+
+#pragma once
+
+#include
+#include
+
+#include "TextLayoutEvent.hpp"
+#include
+#include
+#include "JTextLayoutEvent.hpp"
+#include "TextLayout.hpp"
+#include
+#include "JTextLayout.hpp"
+#include
+
+namespace margelo::nitro::nitrotext {
+
+ using namespace facebook;
+
+ /**
+ * Represents the Java/Kotlin callback `(layout: TextLayoutEvent) -> Unit`.
+ * This can be passed around between C++ and Java/Kotlin.
+ */
+ struct JFunc_void_TextLayoutEvent: public jni::JavaClass {
+ public:
+ static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/nitrotext/Func_void_TextLayoutEvent;";
+
+ public:
+ /**
+ * Invokes the function this `JFunc_void_TextLayoutEvent` instance holds through JNI.
+ */
+ void invoke(const TextLayoutEvent& layout) const {
+ static const auto method = javaClassStatic()->getMethod /* layout */)>("invoke");
+ method(self(), JTextLayoutEvent::fromCpp(layout));
+ }
+ };
+
+ /**
+ * An implementation of Func_void_TextLayoutEvent that is backed by a C++ implementation (using `std::function<...>`)
+ */
+ class JFunc_void_TextLayoutEvent_cxx final: public jni::HybridClass {
+ public:
+ static jni::local_ref fromCpp(const std::function& func) {
+ return JFunc_void_TextLayoutEvent_cxx::newObjectCxxArgs(func);
+ }
+
+ public:
+ /**
+ * Invokes the C++ `std::function<...>` this `JFunc_void_TextLayoutEvent_cxx` instance holds.
+ */
+ void invoke_cxx(jni::alias_ref layout) {
+ _func(layout->toCpp());
+ }
+
+ public:
+ [[nodiscard]]
+ inline const std::function& getFunction() const {
+ return _func;
+ }
+
+ public:
+ static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/nitrotext/Func_void_TextLayoutEvent_cxx;";
+ static void registerNatives() {
+ registerHybrid({makeNativeMethod("invoke_cxx", JFunc_void_TextLayoutEvent_cxx::invoke_cxx)});
+ }
+
+ private:
+ explicit JFunc_void_TextLayoutEvent_cxx(const std::function& func): _func(func) { }
+
+ private:
+ friend HybridBase;
+ std::function _func;
+ };
+
+} // namespace margelo::nitro::nitrotext
diff --git a/nitrogen/generated/android/c++/JHybridNitroTextSpec.cpp b/nitrogen/generated/android/c++/JHybridNitroTextSpec.cpp
new file mode 100644
index 0000000..f7680ee
--- /dev/null
+++ b/nitrogen/generated/android/c++/JHybridNitroTextSpec.cpp
@@ -0,0 +1,455 @@
+///
+/// JHybridNitroTextSpec.cpp
+/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
+/// https://github.com/mrousavy/nitro
+/// Copyright © 2025 Marc Rousavy @ Margelo
+///
+
+#include "JHybridNitroTextSpec.hpp"
+
+// Forward declaration of `Fragment` to properly resolve imports.
+namespace margelo::nitro::nitrotext { struct Fragment; }
+// Forward declaration of `FontWeight` to properly resolve imports.
+namespace margelo::nitro::nitrotext { enum class FontWeight; }
+// Forward declaration of `FontStyle` to properly resolve imports.
+namespace margelo::nitro::nitrotext { enum class FontStyle; }
+// Forward declaration of `TextAlign` to properly resolve imports.
+namespace margelo::nitro::nitrotext { enum class TextAlign; }
+// Forward declaration of `TextTransform` to properly resolve imports.
+namespace margelo::nitro::nitrotext { enum class TextTransform; }
+// Forward declaration of `TextDecorationLine` to properly resolve imports.
+namespace margelo::nitro::nitrotext { enum class TextDecorationLine; }
+// Forward declaration of `TextDecorationStyle` to properly resolve imports.
+namespace margelo::nitro::nitrotext { enum class TextDecorationStyle; }
+// Forward declaration of `Renderer` to properly resolve imports.
+namespace margelo::nitro::nitrotext { enum class Renderer; }
+// Forward declaration of `EllipsizeMode` to properly resolve imports.
+namespace margelo::nitro::nitrotext { enum class EllipsizeMode; }
+// Forward declaration of `LineBreakStrategyIOS` to properly resolve imports.
+namespace margelo::nitro::nitrotext { enum class LineBreakStrategyIOS; }
+// Forward declaration of `DynamicTypeRamp` to properly resolve imports.
+namespace margelo::nitro::nitrotext { enum class DynamicTypeRamp; }
+// Forward declaration of `MenuItem` to properly resolve imports.
+namespace margelo::nitro::nitrotext { struct MenuItem; }
+// Forward declaration of `TextLayoutEvent` to properly resolve imports.
+namespace margelo::nitro::nitrotext { struct TextLayoutEvent; }
+// Forward declaration of `TextLayout` to properly resolve imports.
+namespace margelo::nitro::nitrotext { struct TextLayout; }
+
+#include "Fragment.hpp"
+#include
+#include
+#include "JFragment.hpp"
+#include
+#include "FontWeight.hpp"
+#include "JFontWeight.hpp"
+#include "FontStyle.hpp"
+#include "JFontStyle.hpp"
+#include "TextAlign.hpp"
+#include "JTextAlign.hpp"
+#include "TextTransform.hpp"
+#include "JTextTransform.hpp"
+#include "TextDecorationLine.hpp"
+#include "JTextDecorationLine.hpp"
+#include "TextDecorationStyle.hpp"
+#include "JTextDecorationStyle.hpp"
+#include "Renderer.hpp"
+#include "JRenderer.hpp"
+#include "EllipsizeMode.hpp"
+#include "JEllipsizeMode.hpp"
+#include "LineBreakStrategyIOS.hpp"
+#include "JLineBreakStrategyIOS.hpp"
+#include "DynamicTypeRamp.hpp"
+#include "JDynamicTypeRamp.hpp"
+#include "MenuItem.hpp"
+#include "JMenuItem.hpp"
+#include
+#include "JFunc_void.hpp"
+#include
+#include "TextLayoutEvent.hpp"
+#include "JFunc_void_TextLayoutEvent.hpp"
+#include "JTextLayoutEvent.hpp"
+#include "TextLayout.hpp"
+#include "JTextLayout.hpp"
+
+namespace margelo::nitro::nitrotext {
+
+ jni::local_ref JHybridNitroTextSpec::initHybrid(jni::alias_ref jThis) {
+ return makeCxxInstance(jThis);
+ }
+
+ void JHybridNitroTextSpec::registerNatives() {
+ registerHybrid({
+ makeNativeMethod("initHybrid", JHybridNitroTextSpec::initHybrid),
+ });
+ }
+
+ size_t JHybridNitroTextSpec::getExternalMemorySize() noexcept {
+ static const auto method = javaClassStatic()->getMethod("getMemorySize");
+ return method(_javaPart);
+ }
+
+ void JHybridNitroTextSpec::dispose() noexcept {
+ static const auto method = javaClassStatic()->getMethod("dispose");
+ method(_javaPart);
+ }
+
+ std::string JHybridNitroTextSpec::toString() {
+ static const auto method = javaClassStatic()->getMethod("toString");
+ auto javaString = method(_javaPart);
+ return javaString->toStdString();
+ }
+
+ // Properties
+ std::optional> JHybridNitroTextSpec::getFragments() {
+ static const auto method = javaClassStatic()->getMethod>()>("getFragments");
+ auto __result = method(_javaPart);
+ return __result != nullptr ? std::make_optional([&]() {
+ size_t __size = __result->size();
+ std::vector __vector;
+ __vector.reserve(__size);
+ for (size_t __i = 0; __i < __size; __i++) {
+ auto __element = __result->getElement(__i);
+ __vector.push_back(__element->toCpp());
+ }
+ return __vector;
+ }()) : std::nullopt;
+ }
+ void JHybridNitroTextSpec::setFragments(const std::optional>& fragments) {
+ static const auto method = javaClassStatic()->getMethod> /* fragments */)>("setFragments");
+ method(_javaPart, fragments.has_value() ? [&]() {
+ size_t __size = fragments.value().size();
+ jni::local_ref> __array = jni::JArrayClass::newArray(__size);
+ for (size_t __i = 0; __i < __size; __i++) {
+ const auto& __element = fragments.value()[__i];
+ auto __elementJni = JFragment::fromCpp(__element);
+ __array->setElement(__i, *__elementJni);
+ }
+ return __array;
+ }() : nullptr);
+ }
+ std::optional JHybridNitroTextSpec::getRenderer() {
+ static const auto method = javaClassStatic()->getMethod()>("getRenderer");
+ auto __result = method(_javaPart);
+ return __result != nullptr ? std::make_optional(__result->toCpp()) : std::nullopt;
+ }
+ void JHybridNitroTextSpec::setRenderer(std::optional renderer) {
+ static const auto method = javaClassStatic()->getMethod /* renderer */)>("setRenderer");
+ method(_javaPart, renderer.has_value() ? JRenderer::fromCpp(renderer.value()) : nullptr);
+ }
+ std::optional JHybridNitroTextSpec::getSelectable() {
+ static const auto method = javaClassStatic()->getMethod()>("getSelectable");
+ auto __result = method(_javaPart);
+ return __result != nullptr ? std::make_optional(static_cast(__result->value())) : std::nullopt;
+ }
+ void JHybridNitroTextSpec::setSelectable(std::optional selectable) {
+ static const auto method = javaClassStatic()->getMethod /* selectable */)>("setSelectable");
+ method(_javaPart, selectable.has_value() ? jni::JBoolean::valueOf(selectable.value()) : nullptr);
+ }
+ std::optional JHybridNitroTextSpec::getAllowFontScaling() {
+ static const auto method = javaClassStatic()->getMethod()>("getAllowFontScaling");
+ auto __result = method(_javaPart);
+ return __result != nullptr ? std::make_optional(static_cast(__result->value())) : std::nullopt;
+ }
+ void JHybridNitroTextSpec::setAllowFontScaling(std::optional allowFontScaling) {
+ static const auto method = javaClassStatic()->getMethod /* allowFontScaling */)>("setAllowFontScaling");
+ method(_javaPart, allowFontScaling.has_value() ? jni::JBoolean::valueOf(allowFontScaling.value()) : nullptr);
+ }
+ std::optional JHybridNitroTextSpec::getEllipsizeMode() {
+ static const auto method = javaClassStatic()->getMethod()>("getEllipsizeMode");
+ auto __result = method(_javaPart);
+ return __result != nullptr ? std::make_optional(__result->toCpp()) : std::nullopt;
+ }
+ void JHybridNitroTextSpec::setEllipsizeMode(std::optional ellipsizeMode) {
+ static const auto method = javaClassStatic()->getMethod /* ellipsizeMode */)>("setEllipsizeMode");
+ method(_javaPart, ellipsizeMode.has_value() ? JEllipsizeMode::fromCpp(ellipsizeMode.value()) : nullptr);
+ }
+ std::optional JHybridNitroTextSpec::getNumberOfLines() {
+ static const auto method = javaClassStatic()->getMethod()>("getNumberOfLines");
+ auto __result = method(_javaPart);
+ return __result != nullptr ? std::make_optional(__result->value()) : std::nullopt;
+ }
+ void JHybridNitroTextSpec::setNumberOfLines(std::optional numberOfLines) {
+ static const auto method = javaClassStatic()->getMethod /* numberOfLines */)>("setNumberOfLines");
+ method(_javaPart, numberOfLines.has_value() ? jni::JDouble::valueOf(numberOfLines.value()) : nullptr);
+ }
+ std::optional JHybridNitroTextSpec::getLineBreakStrategyIOS() {
+ static const auto method = javaClassStatic()->getMethod()>("getLineBreakStrategyIOS");
+ auto __result = method(_javaPart);
+ return __result != nullptr ? std::make_optional(__result->toCpp()) : std::nullopt;
+ }
+ void JHybridNitroTextSpec::setLineBreakStrategyIOS(std::optional lineBreakStrategyIOS) {
+ static const auto method = javaClassStatic()->getMethod /* lineBreakStrategyIOS */)>("setLineBreakStrategyIOS");
+ method(_javaPart, lineBreakStrategyIOS.has_value() ? JLineBreakStrategyIOS::fromCpp(lineBreakStrategyIOS.value()) : nullptr);
+ }
+ std::optional JHybridNitroTextSpec::getDynamicTypeRamp() {
+ static const auto method = javaClassStatic()->getMethod()>("getDynamicTypeRamp");
+ auto __result = method(_javaPart);
+ return __result != nullptr ? std::make_optional(__result->toCpp()) : std::nullopt;
+ }
+ void JHybridNitroTextSpec::setDynamicTypeRamp(std::optional dynamicTypeRamp) {
+ static const auto method = javaClassStatic()->getMethod /* dynamicTypeRamp */)>("setDynamicTypeRamp");
+ method(_javaPart, dynamicTypeRamp.has_value() ? JDynamicTypeRamp::fromCpp(dynamicTypeRamp.value()) : nullptr);
+ }
+ std::optional JHybridNitroTextSpec::getMaxFontSizeMultiplier() {
+ static const auto method = javaClassStatic()->getMethod()>("getMaxFontSizeMultiplier");
+ auto __result = method(_javaPart);
+ return __result != nullptr ? std::make_optional(__result->value()) : std::nullopt;
+ }
+ void JHybridNitroTextSpec::setMaxFontSizeMultiplier(std::optional maxFontSizeMultiplier) {
+ static const auto method = javaClassStatic()->getMethod /* maxFontSizeMultiplier */)>("setMaxFontSizeMultiplier");
+ method(_javaPart, maxFontSizeMultiplier.has_value() ? jni::JDouble::valueOf(maxFontSizeMultiplier.value()) : nullptr);
+ }
+ std::optional JHybridNitroTextSpec::getAdjustsFontSizeToFit() {
+ static const auto method = javaClassStatic()->getMethod()>("getAdjustsFontSizeToFit");
+ auto __result = method(_javaPart);
+ return __result != nullptr ? std::make_optional(static_cast(__result->value())) : std::nullopt;
+ }
+ void JHybridNitroTextSpec::setAdjustsFontSizeToFit(std::optional adjustsFontSizeToFit) {
+ static const auto method = javaClassStatic()->getMethod /* adjustsFontSizeToFit */)>("setAdjustsFontSizeToFit");
+ method(_javaPart, adjustsFontSizeToFit.has_value() ? jni::JBoolean::valueOf(adjustsFontSizeToFit.value()) : nullptr);
+ }
+ std::optional JHybridNitroTextSpec::getMinimumFontScale() {
+ static const auto method = javaClassStatic()->getMethod()>("getMinimumFontScale");
+ auto __result = method(_javaPart);
+ return __result != nullptr ? std::make_optional(__result->value()) : std::nullopt;
+ }
+ void JHybridNitroTextSpec::setMinimumFontScale(std::optional minimumFontScale) {
+ static const auto method = javaClassStatic()->getMethod /* minimumFontScale */)>("setMinimumFontScale");
+ method(_javaPart, minimumFontScale.has_value() ? jni::JDouble::valueOf(minimumFontScale.value()) : nullptr);
+ }
+ std::optional> JHybridNitroTextSpec::getMenus() {
+ static const auto method = javaClassStatic()->getMethod>()>("getMenus");
+ auto __result = method(_javaPart);
+ return __result != nullptr ? std::make_optional([&]() {
+ size_t __size = __result->size();
+ std::vector