Skip to content

devraj-labs/rn-font-inter

Repository files navigation

Inter Font for React Native

Inter font, packaged for React Native. Exports a typed weight map (PostScript names) that resolves correctly on both iOS and Android — no Platform.select, no manual fontFamily string guessing.

React Native 0.60+
iOS
Android

Install

npm install @devraj-labs/rn-font-inter

Then add (or update) react-native.config.js in your app root to include the font assets:

module.exports = {
  assets: [
    './node_modules/@devraj-labs/rn-font-inter/assets/fonts',
    // ...other font packages
  ],
};

Then link the fonts into your native projects:

npx react-native-asset

Re-run npx react-native-asset and rebuild your app whenever you add or update a font package.

Usage

With Vajra UI

Register the font in your theme and use it via the font prop:

import { interFonts } from '@devraj-labs/rn-font-inter';

createVajraTheme({
  typography: {
    fonts: {
      families: {
        ...interFonts,
      },
    },
  },
});
<Text font="inter18pt" fontWeight="100">Sample text</Text>
<Text font="inter18pt" fontWeight="200">Sample text</Text>
<Text font="inter24pt" fontWeight="100">Sample text</Text>
<Text font="inter24pt" fontWeight="200">Sample text</Text>
<Text font="inter28pt" fontWeight="100">Sample text</Text>
<Text font="inter28pt" fontWeight="200">Sample text</Text>

Without Vajra UI

The export is a plain object — use it however your app resolves fonts:

import { interFonts } from '@devraj-labs/rn-font-inter';

const styles = StyleSheet.create({
  // interFonts.inter18pt['100'] → 'Inter18pt-Thin'
  heading: { fontFamily: interFonts.inter18pt['100'], fontSize: 24 },
  body:    { fontFamily: interFonts.inter18pt['900'], fontSize: 16 },
  // interFonts.inter24pt['100'] → 'Inter24pt-Thin'
  heading: { fontFamily: interFonts.inter24pt['100'], fontSize: 24 },
  body:    { fontFamily: interFonts.inter24pt['900'], fontSize: 16 },
  // interFonts.inter28pt['100'] → 'Inter28pt-Thin'
  heading: { fontFamily: interFonts.inter28pt['100'], fontSize: 24 },
  body:    { fontFamily: interFonts.inter28pt['900'], fontSize: 16 },
});

Font map

Family Weight PostScript name
inter18pt '100' 'Inter18pt-Thin'
inter18pt '200' 'Inter18pt-ExtraLight'
inter18pt '300' 'Inter18pt-Light'
inter18pt '400' 'Inter18pt-Regular'
inter18pt '500' 'Inter18pt-Medium'
inter18pt '600' 'Inter18pt-SemiBold'
inter18pt '700' 'Inter18pt-Bold'
inter18pt '800' 'Inter18pt-ExtraBold'
inter18pt '900' 'Inter18pt-Black'
inter24pt '100' 'Inter24pt-Thin'
inter24pt '200' 'Inter24pt-ExtraLight'
inter24pt '300' 'Inter24pt-Light'
inter24pt '400' 'Inter24pt-Regular'
inter24pt '500' 'Inter24pt-Medium'
inter24pt '600' 'Inter24pt-SemiBold'
inter24pt '700' 'Inter24pt-Bold'
inter24pt '800' 'Inter24pt-ExtraBold'
inter24pt '900' 'Inter24pt-Black'
inter28pt '100' 'Inter28pt-Thin'
inter28pt '200' 'Inter28pt-ExtraLight'
inter28pt '300' 'Inter28pt-Light'
inter28pt '400' 'Inter28pt-Regular'
inter28pt '500' 'Inter28pt-Medium'
inter28pt '600' 'Inter28pt-SemiBold'
inter28pt '700' 'Inter28pt-Bold'
inter28pt '800' 'Inter28pt-ExtraBold'
inter28pt '900' 'Inter28pt-Black'

Docs

License

MIT

About

Inter font package for React Native

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors