feat: support PostScript names for fonts

This commit is contained in:
Erzbir
2026-08-20 15:07:35 +08:00
parent a72f97611d
commit c537f88f2e
2 changed files with 11 additions and 4 deletions
+4 -3
View File
@@ -155,8 +155,9 @@
[# th:each="font : ${theme.config.style.custom_fonts}"]
@font-face {
font-display: swap;
font-family: "[(${font.name})]";
src: local("[(${font.name})]"), url("[(${font.file})]") format("[(${font.format})]");
font-family: "[(${font.family_name})]";
src: local("[(${#strings.isEmpty(font.postscript_name) ? font.family_name : font.postscript_name})]"),
url("[(${font.file})]") format("[(${font.format})]");
font-style: [(${font.advanced ? #objects.nullSafe(font.style, 'normal') : 'normal'})];
font-weight: [(${font.advanced ? #objects.nullSafe(font.weight, '400') : '400'})];
font-display: [(${font.advanced ? #objects.nullSafe(font.display, 'swap') : 'swap'})];
@@ -190,7 +191,7 @@
:root {
--family-theme-font:
[# th:each="font, stat : ${theme.config.style.custom_fonts}"]
"[(${font.name})]"[# th:if="${!stat.last}"],[/]
"[(${font.family_name})]"[# th:if="${!stat.last}"],[/]
[/];
}
</style>