Skip to content

Commit

Permalink
feat(shapers): Add dummy shaper for use with alternative backends tha…
Browse files Browse the repository at this point in the history
…t don't need shaping
  • Loading branch information
alerque committed Oct 3, 2024
1 parent 4e32629 commit c2c608b
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/sile.lua
Original file line number Diff line number Diff line change
Expand Up @@ -222,10 +222,10 @@ function SILE.init ()
SILE.shaper = SILE.shapers.harfbuzz()
SILE.outputter = SILE.outputters.debug()
elseif SILE.backend == "text" then
SILE.shaper = SILE.shapers.harfbuzz()
SILE.shaper = SILE.shapers.dummy()
SILE.outputter = SILE.outputters.text()
elseif SILE.backend == "dummy" then
SILE.shaper = SILE.shapers.harfbuzz()
SILE.shaper = SILE.shapers.dummy()
SILE.outputter = SILE.outputters.dummy()
end
SILE.pagebuilder = SILE.pagebuilders.base()
Expand Down
28 changes: 28 additions & 0 deletions shapers/dummy.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
local base = require("shapers.base")

local shaper = pl.class(base)
shaper._name = "dummy"

function shaper.addShapedGlyphToNnodeValue (_, _, _) end

function shaper.checkHBProblems (_, _, _) end

function shaper.debugVersions (_) end

function shaper.getFace () end

function shaper.makeSpaceNode (_, _, _) end

function shaper.preAddNodes (_, _, _) end

function shaper:createNnodes (_, _) end

function shaper:formNnode (_, _, _) end

function shaper:measureChar (_) end

function shaper:measureSpace (_) end

function shaper:shapeToken (_, _) end

return shaper

0 comments on commit c2c608b

Please sign in to comment.