Skip to content

Commit

Permalink
feat(math): Add math.font.filename setting
Browse files Browse the repository at this point in the history
  • Loading branch information
OlivierNicole authored and alerque committed Sep 8, 2021
1 parent 959d1cc commit 522d70b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions core/math.lua
Expand Up @@ -97,6 +97,7 @@ local mathScriptConversionTable = {
}

SILE.settings.declare({name = "math.font.family", type = "string", default = "XITS Math"})
SILE.settings.declare({name = "math.font.filename", type = "string", default = ""})
SILE.settings.declare({name = "math.font.size", type = "integer", default = 10})
-- Whether to show debug boxes around mboxes
SILE.settings.declare({name = "math.debug.boxes", type = "boolean", default = false})
Expand Down Expand Up @@ -139,6 +140,9 @@ local function getMathMetrics()
family=SILE.settings.get("math.font.family"),
size=SILE.settings.get("math.font.size")
}
local filename = SILE.settings.get("math.font.filename")
print("filename = " .. filename)
if filename and filename ~= "" then options.filename = filename end
mathCache = retrieveMathTable(options)
return mathCache
end
Expand Down Expand Up @@ -262,6 +266,8 @@ local _mbox = _box {
family=SILE.settings.get("math.font.family"),
size=SILE.settings.get("math.font.size")
}
local filename = SILE.settings.get("math.font.filename")
if filename and filename ~= "" then options.filename = filename end
self.options = SILE.font.loadDefaults(options)
end,

Expand Down

0 comments on commit 522d70b

Please sign in to comment.