1.3 KiB
1.3 KiB
Font Files
This directory contains TrueType Font (TTF) files used for server-side image generation with PHP GD.
Carlito-Bold.ttf
- Font: Carlito Bold
- Source: Google Fonts (Carlito Project)
- License: SIL Open Font License 1.1
- URL: https://github.com/googlefonts/carlito
- Usage: Used by
BattleCardGeneratorservice for generating battle card OG images - Note: Carlito is a metric-compatible font family to Calibri
Why TTF instead of @fontsource?
The @fontsource npm packages provide WOFF/WOFF2 files for web usage, but PHP's GD library (imagettftext()) requires TrueType Font (TTF) files for server-side text rendering.
Alternatives
If you want to use a different font:
-
Install system fonts:
# Find available TTF fonts find /usr/share/fonts -name "*.ttf" -type f # Copy desired font cp /usr/share/fonts/path/to/Font-Bold.ttf assets/fonts/ -
Download from Google Fonts:
# Visit https://fonts.google.com # Download the font family # Extract the TTF file from the zip -
Update service configuration: Edit
config/services.yamland update the$fontPathparameter.
Cache Clearing
After changing fonts, clear the OG image cache:
rm -rf var/og-cache/*