Relax font alias pattern to allow custom font families

Update the font alias regex pattern from:
    (mono|sans)-(bold-|italic-)?(stroke-)?[0-9]{1,3}
to:
    [a-z]+-(bold-|italic-)?(stroke-)?[0-9]{1,3}

Previously the pattern only allowed the `mono` and `sans` font families.
This change generalizes the pattern to accept any lowercase font family
name, making it compatible with the font alias convention described in:

https://gitea.wildfiregames.com/0ad/0ad/wiki/Adding_font_support

This allows new fonts to be registered through aliases without modifying
the regex each time a new family is introduced.
This commit is contained in:
trompetin17
2026-03-04 17:43:20 -05:00
parent 01476b9836
commit 15076a4504
+1 -1
View File
@@ -89,7 +89,7 @@
</define>
<define name="font">
<data type="string">
<param name="pattern">(mono|sans)-(bold-|italic-)?(stroke-)?[0-9]{1,3}</param>
<param name="pattern">[a-z]+-(bold-|italic-)?(stroke-)?[0-9]{1,3}</param>
</data>
</define>
<define name="size">