forked from HEL/circuiteria
font arguement, radius arguement
now in `block.typ` the radius is optional and the font can be set in the canvas
This commit is contained in:
@@ -8,7 +8,7 @@
|
|||||||
/// - body (none, array, element): A code block in which draw functions have been called
|
/// - body (none, array, element): A code block in which draw functions have been called
|
||||||
/// - length (length, ratio): Optional base unit
|
/// - length (length, ratio): Optional base unit
|
||||||
/// -> none
|
/// -> none
|
||||||
#let circuit(body, length: 2em) = {
|
#let circuit(body, length: 2em, font: "Source Sans 3") = {
|
||||||
set text(font: "Source Sans 3")
|
set text(font: font)
|
||||||
canvas(length: length, body)
|
canvas(length: length, body)
|
||||||
}
|
}
|
||||||
|
@@ -1,9 +1,9 @@
|
|||||||
#import "@preview/cetz:0.3.2": draw
|
#import "@preview/cetz:0.3.2": draw
|
||||||
#import "element.typ"
|
#import "element.typ"
|
||||||
|
|
||||||
#let draw-shape(id, tl, tr, br, bl, fill, stroke) = {
|
#let draw-shape(id, tl, tr, br, bl, fill, stroke, radius) = {
|
||||||
let f = draw.rect(
|
let f = draw.rect(
|
||||||
radius: 0.5em,
|
radius: radius,
|
||||||
inset: 0.5em,
|
inset: 0.5em,
|
||||||
fill: fill,
|
fill: fill,
|
||||||
stroke: stroke,
|
stroke: stroke,
|
||||||
@@ -27,13 +27,14 @@
|
|||||||
ports: (),
|
ports: (),
|
||||||
ports-margins: (),
|
ports-margins: (),
|
||||||
fill: none,
|
fill: none,
|
||||||
|
radius: 0.5em,
|
||||||
stroke: black + 1pt,
|
stroke: black + 1pt,
|
||||||
id: "",
|
id: "",
|
||||||
debug: (
|
debug: (
|
||||||
ports: false
|
ports: false
|
||||||
)
|
)
|
||||||
) = element.elmt(
|
) = element.elmt(
|
||||||
draw-shape: draw-shape,
|
draw-shape: draw-shape.with(radius: radius),
|
||||||
x: x,
|
x: x,
|
||||||
y: y,
|
y: y,
|
||||||
w: w,
|
w: w,
|
||||||
@@ -46,4 +47,4 @@
|
|||||||
stroke: stroke,
|
stroke: stroke,
|
||||||
id: id,
|
id: id,
|
||||||
debug: debug
|
debug: debug
|
||||||
)
|
)
|
||||||
|
Reference in New Issue
Block a user