@riverty/fonts
v2.2.1
Published
Riverty Design System: fonts
Keywords
Readme
Riverty Design System: Fonts
Riverty, your flexible Payment Companion. 25+ million users, 1+ billion secure transactions.
Riverty Design System: a design and development toolkit tailor-made for Riverty teams and collaborators.
Contributing
We welcome contributions to the Fonts package! This package manages web fonts and @font-face definitions.
Development Setup
cd packages/fonts
npm install
npm run build # Process fonts and generate CSSStructure
src/
├── fonts/ # Font files (woff2, woff, etc.)
└── font-faces.scss # @font-face definitionsFont Configuration
Font metadata is defined in fonts.json:
{
"fonts": [
{
"family": "Riverty Sans",
"weight": 400,
"style": "normal",
"files": {
"woff2": "riverty-sans-regular.woff2",
"woff": "riverty-sans-regular.woff"
}
}
]
}Working with Fonts
Adding new font files:
- Place font files in
src/fonts/ - Update
fonts.jsonwith metadata - Run
npm run build
- Place font files in
Testing font loading:
npm run build cd ../website npm run startVerify @font-face declarations:
- Check generated files in
lib/ - Test loading in different browsers
- Verify fallback behavior
- Check generated files in
Best Practices
- Maintain font file integrity (don't modify font files directly)
- Update font metadata accurately
- Include multiple formats (woff2, woff) for browser support
- Optimize font files for web (subset if possible)
- Test @font-face declarations
- Verify CDN compatibility
- Document font licensing
- Test font loading performance
Font Formats
Supported formats (in order of preference):
- WOFF2 - Modern format, best compression
- WOFF - Fallback for older browsers
Testing
# Build fonts
npm run build
# Verify artifacts (if available)
npm run verify:artifactsUseful Commands
npm run build- Process fonts and generate CSSnpm run verify:artifacts- Verify build outputs
For complete contribution guidelines, see CONTRIBUTING.md in the repository root.
