Tengo un problema en el que la font-family no funciona en mi aplicación, especialmente al aplicar texto en negrita. Ya coloqué toda mi fuente en mi android/app/src/main/assets/fonts y ejecuté el comando react-native link
./constantes/tema.js
import { Dimensions } from "react-native"; const { width, height } = Dimensions.get("window"); export const FONTS = { h1: { fontFamily: "Roboto-Black", fontSize: SIZES.h1, lineHeight: 36 }, h2: { fontFamily: "Roboto-Bold", fontSize: SIZES.h2, lineHeight: 30 }, h3: { fontFamily: "Roboto-Bold", fontSize: SIZES.h3, lineHeight: 22 }, h4: { fontFamily: "Roboto-Bold", fontSize: SIZES.h4, lineHeight: 22 }, body1: { fontFamily: "Roboto-Regular", fontSize: SIZES.body1, lineHeight: 36 }, body2: { fontFamily: "Roboto-Regular", fontSize: SIZES.body2, lineHeight: 30 }, body3: { fontFamily: "Roboto-Regular", fontSize: SIZES.body3, lineHeight: 22 }, body4: { fontFamily: "Roboto-Regular", fontSize: SIZES.body4, lineHeight: 22 }, body5: { fontFamily: "Roboto-Regular", fontSize: SIZES.body5, lineHeight: 22 }, }; export const COLORS = { primary: "#7F5DF0", // Light purple secondary: "#5D2DFD", // Dark purple white: "#fff", black: "#000000", green: "#37E39F", red: "#F9A8BA", gray: "#6A6A6A", lightGray: "#dbdbdb", lightGray1: "#f5f6fa" }; export const SIZES = { // global sizes base: 8, font: 14, radius: 12, padding: 24, // font sizes h1: 30, h2: 22, h3: 16, h4: 14, body1: 30, body2: 22, body3: 16, body4: 14, body5: 12, // app dimensions width, height }; const appTheme = { COLORS, SIZES, FONTS }; export default appTheme; Y cuando lo devuelvo cuando uso ...FONTS.h3 el texto no estaba en negrita a pesar de que declaré texto en negrita
import {COLORS, FONTS} from '../constants'; <View> <Text style={{...FONTS.h3, ...COLORS.green}}>Text with bold and green color</Text> </View>./contants/index.js
import icons from "./icons"; import images from "./images"; import theme, { COLORS, SIZES, FONTS } from "./theme"; export { icons, images, theme, COLORS, SIZES, FONTS };