-
-
Notifications
You must be signed in to change notification settings - Fork 306
Description
Would it be possible to create named font stacks in the config.yaml? I am having trouble using glyphs served by Martin as it doesn't do any merging of fonts. Currently I have pre-generated the pbf font ranges thus merging fallbacks for each style. With Martin, I would have to adjust all the layers in my stylesheet to support composite fonts, but this also creates an issue with font styles like "Italic" and "Bold Italic".
For example, when I add the fallback fonts to my stylesheet:
text-font: ['Noto Sans Bold Italic', 'Noto Sans Arabic Bold']MapLibre requests the non-existant:
/fonts/Noto Sans Arabic Bold Italic/{range}
Rather than:
/fonts/Noto Sans Bold Italic,Noto Sans Arabic Bold/{range}
Another problem with specifying multiple languages in the stylesheet is that it could become very verbose especially if you want to support many writing systems. You could end up writing 10-15 font names for each layer.
My proposition would be to define named stacks in the config.yaml. I imagine it would look something like this:
fonts:
sources:
# Define named font stacks
"Noto Sans Regular":
- /fonts/NotoSans-Regular.ttf # Latin/Greek/Cyrillic
- /fonts/NotoSansArabic-Regular.ttf # Arabic fallback
- /fonts/NotoSansThai-Regular.ttf # Thai fallback
"Noto Sans Bold":
- /fonts/NotoSans-Bold.ttf
- /fonts/NotoSansArabic-Bold.ttf
- /fonts/NotoSansThai-Bold.ttf
"Noto Sans Italic":
- /fonts/NotoSans-Italic.ttf
- /fonts/NotoSansArabic-Regular.ttf # Arabic and Thai doesn't have italic, use regular
- /fonts/NotoSansThai-Regular.ttf
"Noto Sans Bold Italic":
- /fonts/NotoSans-BoldItalic.ttf
- /fonts/NotoSansArabic-Bold.ttf # Use bold for bold italic fallback
- /fonts/NotoSansThai-Bold.ttfDoes this make sense, or is there a cleaner way to go about this that is already available?