Expo Font Loader
A VS Code extension to simplify adding and managing custom fonts in Expo projects, including integration with Google Fonts.
Features
- Automatically detect font files in your Expo project
- Select which fonts to load with an intuitive interface
- Generate and insert font loading code into your project
- Support for multiple font file formats (TTF, OTF)
- Configurable font directories
- Option for automatic font loading on project open
- Browse and add fonts from Google Fonts
- Preview fonts before adding them to your project
Installation
- Open VS Code
- Go to Extensions (Ctrl+Shift+X)
- Search for "Expo Font Loader"
- Click Install
Usage
Loading Local Fonts
- Open your Expo project in VS Code
- Press
Ctrl+Shift+P (or Cmd+Shift+P on macOS) to open the command palette
- Type "Expo: Load Fonts" and select the command
- The extension will scan your project for font files
- Select the fonts you want to load from the list
- The extension will generate the necessary code and insert it into your active file
Adding Google Fonts
- Open your Expo project in VS Code
- Press
Ctrl+Shift+P (or Cmd+Shift+P on macOS) to open the command palette
- Type "Expo: Add Google Fonts" and select the command
- Browse the list of available Google Fonts
- Select a font to preview it
- Confirm your selection to add the font to your project
The extension will download the selected Google Font, add it to your project, and update the necessary configuration files.
Configuration
You can configure the extension in your VS Code settings:
expoFontLoader.autoLoad : Whether to automatically load fonts on project open (default: false)
expoFontLoader.googleFontsApiKey : Your Google Fonts API key (required for accessing Google Fonts)
Troubleshooting
If you encounter any issues:
- Ensure your font files are in the correct directory
- Check that your Expo project is set up correctly
- Verify that you have the necessary dependencies installed (
expo-font )
- For Google Fonts issues, make sure you've set up a valid Google Fonts API key in the extension settings
License
This project is licensed under the MIT License
| |