Private
Public Access
1
0
Files
MineSeeker/docs/FONTS.md

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 BattleCardGenerator service 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:

  1. 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/
    
  2. Download from Google Fonts:

    # Visit https://fonts.google.com
    # Download the font family
    # Extract the TTF file from the zip
    
  3. Update service configuration: Edit config/services.yaml and update the $fontPath parameter.

Cache Clearing

After changing fonts, clear the OG image cache:

rm -rf var/og-cache/*