Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 14 additions & 8 deletions packages/react-native/ReactAndroid/api/ReactAndroid.api
Original file line number Diff line number Diff line change
Expand Up @@ -7294,14 +7294,20 @@ public abstract class com/facebook/react/views/text/ReactBaseTextShadowNode : co
protected fun spannedFromShadowNode (Lcom/facebook/react/views/text/ReactBaseTextShadowNode;Ljava/lang/String;ZLcom/facebook/react/uimanager/NativeViewHierarchyOptimizer;)Landroid/text/Spannable;
}

public class com/facebook/react/views/text/ReactFontManager {
public fun addCustomFont (Landroid/content/Context;Ljava/lang/String;I)V
public fun addCustomFont (Ljava/lang/String;Landroid/graphics/Typeface;)V
public static fun getInstance ()Lcom/facebook/react/views/text/ReactFontManager;
public fun getTypeface (Ljava/lang/String;IILandroid/content/res/AssetManager;)Landroid/graphics/Typeface;
public fun getTypeface (Ljava/lang/String;ILandroid/content/res/AssetManager;)Landroid/graphics/Typeface;
public fun getTypeface (Ljava/lang/String;IZLandroid/content/res/AssetManager;)Landroid/graphics/Typeface;
public fun setTypeface (Ljava/lang/String;ILandroid/graphics/Typeface;)V
public final class com/facebook/react/views/text/ReactFontManager {
public static final field Companion Lcom/facebook/react/views/text/ReactFontManager$Companion;
public synthetic fun <init> (Lcom/facebook/react/views/text/ReactFontManager;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
public final fun addCustomFont (Landroid/content/Context;Ljava/lang/String;I)V
public final fun addCustomFont (Ljava/lang/String;Landroid/graphics/Typeface;)V
public static final fun getInstance ()Lcom/facebook/react/views/text/ReactFontManager;
public final fun getTypeface (Ljava/lang/String;IILandroid/content/res/AssetManager;)Landroid/graphics/Typeface;
public final fun getTypeface (Ljava/lang/String;ILandroid/content/res/AssetManager;)Landroid/graphics/Typeface;
public final fun getTypeface (Ljava/lang/String;IZLandroid/content/res/AssetManager;)Landroid/graphics/Typeface;
public final fun setTypeface (Ljava/lang/String;ILandroid/graphics/Typeface;)V
}

public final class com/facebook/react/views/text/ReactFontManager$Companion {
public final fun getInstance ()Lcom/facebook/react/views/text/ReactFontManager;
}

public class com/facebook/react/views/text/ReactRawTextManager : com/facebook/react/uimanager/ViewManager {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

package com.facebook.react.views.text

import android.content.Context
import android.content.res.AssetManager
import android.graphics.Typeface

/** Responsible for loading and caching Typeface objects. */
@Deprecated(
message =
"This class is deprecated and will be deleted in the near future. Please use [com.facebook.react.common.assets.ReactFontManager] instead.")
@Suppress("DEPRECATION")
public class ReactFontManager private constructor(private val delegate: ReactFontManager) {

public fun getTypeface(fontFamilyName: String, style: Int, assetManager: AssetManager): Typeface =
delegate.getTypeface(fontFamilyName, style, assetManager)

public fun getTypeface(
fontFamilyName: String,
weight: Int,
italic: Boolean,
assetManager: AssetManager
): Typeface = delegate.getTypeface(fontFamilyName, weight, italic, assetManager)

public fun getTypeface(
fontFamilyName: String,
style: Int,
weight: Int,
assetManager: AssetManager
): Typeface = delegate.getTypeface(fontFamilyName, style, weight, assetManager)

public fun addCustomFont(context: Context, fontFamily: String, fontId: Int) {
delegate.addCustomFont(context, fontFamily, fontId)
}

public fun addCustomFont(fontFamily: String, font: Typeface?) {
delegate.addCustomFont(fontFamily, font)
}

public fun setTypeface(fontFamilyName: String, style: Int, typeface: Typeface) {
delegate.setTypeface(fontFamilyName, style, typeface)
}

public companion object {
private var instance: ReactFontManager? = null

@JvmStatic
public fun getInstance(): ReactFontManager {
return instance ?: ReactFontManager(ReactFontManager.getInstance()).also { instance = it }
}
}
}