Skip to content

Commit

Permalink
feat(packages): Add function to remove last added fallback font
Browse files Browse the repository at this point in the history
  • Loading branch information
alerque committed Sep 21, 2021
1 parent 3aba931 commit acf987b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/font-fallback.lua
Expand Up @@ -54,6 +54,10 @@ SILE.registerCommand("font:add-fallback", function (options, _)
fontlist[#fontlist+1] = options
end)

SILE.registerCommand("font:remove-fallback", function ()
fontlist[#fontlist] = nil
end, "Pop last added fallback from fallback stack")

SILE.shapers.harfbuzzWithFallback = pl.class({
_base = SILE.shapers.harfbuzz,

Expand Down Expand Up @@ -211,5 +215,8 @@ and SILE will produce:
\command{\\font:clear-fallbacks} removes all font fallbacks from the list
of fonts to try.
\command{\\font:remove-fallback} removes the last added fallback from the
list of fonts to try.
\font:clear-fallbacks
\end{document} ]]}

0 comments on commit acf987b

Please sign in to comment.