Remove typst plugin
It was nice but really slow.
This commit is contained in:
parent
3a2637bb34
commit
d9dbd90ff2
12 changed files with 1 additions and 576 deletions
|
|
@ -23,38 +23,3 @@
|
|||
// Determined by experiments so that the top and bottom white border are roughly
|
||||
// the same size after tearing off the paper.
|
||||
#let feed = v(64pt + 32pt)
|
||||
|
||||
////////////
|
||||
// Plugin //
|
||||
////////////
|
||||
|
||||
#import plugin("plugin.wasm") as p
|
||||
|
||||
#let _number_to_bytes(n) = int(n).to-bytes(size: 8)
|
||||
|
||||
#let _bool_to_bytes(b) = _number_to_bytes(if b { 1 } else { 0 })
|
||||
|
||||
#let _str_to_bytes(s) = {
|
||||
bytes(s)
|
||||
}
|
||||
|
||||
#let _length_to_bytes(l) = {
|
||||
let l = l.pt()
|
||||
let n = if l > 10000 { -1 } else { int(l) }
|
||||
_number_to_bytes(n)
|
||||
}
|
||||
|
||||
#let dither(
|
||||
data,
|
||||
bright: true,
|
||||
algorithm: "floyd-steinberg",
|
||||
) = layout(size => {
|
||||
let dithered = p.dither(
|
||||
data,
|
||||
_length_to_bytes(size.width),
|
||||
_length_to_bytes(size.height),
|
||||
_bool_to_bytes(bright),
|
||||
_str_to_bytes(algorithm),
|
||||
)
|
||||
image(dithered)
|
||||
})
|
||||
|
|
|
|||
|
|
@ -1 +0,0 @@
|
|||
../../../../showbits-typst-plugin/target/wasm32-unknown-unknown/release/showbits_typst_plugin.wasm
|
||||
Loading…
Add table
Add a link
Reference in a new issue