Skip to content

Instantly share code, notes, and snippets.

@cormullion
Last active July 6, 2021 13:26
Show Gist options
  • Save cormullion/5eead5006ccfd1c306e16cd1c8838134 to your computer and use it in GitHub Desktop.
Save cormullion/5eead5006ccfd1c306e16cd1c8838134 to your computer and use it in GitHub Desktop.
Alias text test
using Luxor
function make_matrix()
Drawing(40, 40, :image)
background(1, 1, 1, 1)
setantialias(0)
origin()
setcolor(0, 0, 0, 1)
fontsize(40)
text("a", halign=:center, valign=:middle)
matrix = image_as_matrix()
finish()
return matrix
end
function draw()
matrix = make_matrix()
@png begin
background(0, 0, 0, 1)
table = Table(size(matrix)..., (15, 15))
for i in CartesianIndices(matrix)
r, c = Tuple(i)
setcolor(matrix[r, c])
box(table, r, c, :fillstroke)
end
end 400 400 "/tmp/alias-test.png"
end
draw()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment