Fonts
Themes store font family names and weights; your app supplies the font files. This guide uses the acme theme from Create a Theme and an example font named “Acme Sans”.
Add your font files
Bundle the fonts with your app using your usual setup, such as expo-font in Expo. Default typography uses weights 400 and 500, so include at least the regular and medium faces.
On Android, register the faces as one font family, such as an XML font-family resource, so fontWeight selects the right face. Until a family is registered, text falls back to the system font.
Set the theme font families
Add fontFamily inside themes.acme.globalTokens:
fontFamily: {
heading: { family: '"Acme Sans", sans-serif' },
body: { family: '"Acme Sans", sans-serif' },
},bun run build:themeNative output keeps the first family without quotes, so fontFamily becomes "Acme Sans". It must match the family name inside the font file, not the file name.
Adjust typography
Add typography inside themes.acme.semanticTokens:
typography: {
bodyMdRegularMobile: {
fontFamily: "body",
size: "125",
weight: "regular",
lineHeight: "600",
letterSpacing: "normal",
},
},Each field references a global token; include all five. Native output uses the mobile recipes without the Mobile suffix, so this becomes theme.typography.bodyMdRegular. See the typography reference for names and values.
Style your own text
Spread a recipe into a React Native Text style and add a color for the current mode:
import { useTheme } from "@vortexlabs/vortex-native";
import type { ReactNode } from "react";
import { Text } from "react-native";
export const BodyText = ({ children }: { children: ReactNode }) => {
const { theme, colorMode } = useTheme();
return (
<Text
maxFontSizeMultiplier={theme.maxFontSizeMultiplier}
style={[theme.typography.bodyMdRegular, { color: theme.color[colorMode].foregroundDefault }]}
>
{children}
</Text>
);
};Recipes hold absolute fontSize, lineHeight, and letterSpacing values. Global fontLineHeight and fontLetterSpacing tokens hold ratios, so don't pass them to text styles directly.
Pass maxFontSizeMultiplier so custom text scales with the system text size like Vortex Text.