font handling fix

This commit is contained in:
rodolfomartinez 2026-02-02 11:04:00 -05:00
parent d5ecb31dad
commit fda7bd1d12
6 changed files with 727 additions and 22 deletions

View file

@ -170,6 +170,7 @@ class MLF_Font_Downloader {
[300, 400, 500, 600, 700], // Common range
[400, 500, 600, 700], // Without light
[400, 700], // Just regular and bold
[400], // Single weight (display fonts)
];
$css = null;
@ -227,7 +228,8 @@ class MLF_Font_Downloader {
$family = str_replace(' ', '+', $font_name);
// Try different weight ranges - fonts support varying ranges
$weight_ranges = ['300..900', '300..800', '300..700', '400..700'];
// Also try single weight 400 for fonts that only have one weight
$weight_ranges = ['300..900', '300..800', '300..700', '400..700', '400'];
foreach ($weight_ranges as $range) {
if ($italic) {