diff --git a/src/resources/filters/modules/brand/brand.lua b/src/resources/filters/modules/brand/brand.lua index ddb2d5b1e71..5e8611e13f0 100644 --- a/src/resources/filters/modules/brand/brand.lua +++ b/src/resources/filters/modules/brand/brand.lua @@ -32,6 +32,9 @@ local function get_typography(fontName) if not brand then return nil end local typography = brand.typography and brand.typography[fontName] if not typography then return nil end + if type(typography) == 'string' then + typography = { family = typography } + end local typsted = {} for k, v in pairs(typography) do if k == 'color' or k == 'background-color' then diff --git a/tests/docs/smoke-all/2024/10/28/brand-typography-family-string/_brand.yml b/tests/docs/smoke-all/2024/10/28/brand-typography-family-string/_brand.yml new file mode 100644 index 00000000000..46c12f093b1 --- /dev/null +++ b/tests/docs/smoke-all/2024/10/28/brand-typography-family-string/_brand.yml @@ -0,0 +1,11 @@ +color: + palette: + white: "#eeddcc" + black: "#112233" + foreground: black + background: white +typography: + fonts: + - family: "Roboto Slab" + source: google + base: "Roboto Slab" \ No newline at end of file diff --git a/tests/docs/smoke-all/2024/10/28/brand-typography-family-string/test.qmd b/tests/docs/smoke-all/2024/10/28/brand-typography-family-string/test.qmd new file mode 100644 index 00000000000..5c14fb97e78 --- /dev/null +++ b/tests/docs/smoke-all/2024/10/28/brand-typography-family-string/test.qmd @@ -0,0 +1,16 @@ +--- +format: typst +title: Hello +--- + +## This is a section + +This is a paragraph. + +## This is another section + +This is another paragraph. + +``` +some code. +``` \ No newline at end of file