size(595, 840)
background(0.6)
# fundo
rotacao = [1, 5, 20]
translate(0,0)
for x, y in grid (20, 45, 30, 22):
fill(0.7)
rotate(choice(rotacao))
rect(5+x, 5+y, 15, 2)
reset()
# listas do “Hagd” e alfabeto
fonte = [“Garamond Premier Pro”, “Helvetica”, “Fette Fraktur”, “LinotypeZapfinoOne”, “OCR A Std”]
texto = [“Garamond Premier Pro”, “Helvetica”, “Fette Fraktur”, “LinotypeZapfinoOne”, “OCR A Std”]
ABC = “ABCDEFGHIJKLMNOPQRSTUVWXYZ”
abc = “abcdefghijklmnopqrstuvwxyz 1234567890”
tamanhohagd = [225, 200, 200, 250, 180]
coordenadahagd = [272, 210, 235, 290, 252]
indice = random(0,4)
# formatacao do “Hagd”, mais ligacao com o tamanho e coordenadas em y
fill(1, 1, 0)
font(fonte[indice], tamanhohagd[indice])
align(CENTER)
text(“Hagd”, 0, coordenadahagd[indice], width=WIDTH)
# formatacao do alfabeto, com o nome da fonte dependentes das variaveis do “Hagd”
fill(0)
font(fonte[indice], 30)
text(texto[indice], 100, 385)
font(fonte[indice], 15)
text(ABC, 100, 420)
font(fonte[indice], 15)
text(abc, 100, 445)
# variaveis das coordenadas das linhas (ascender, cap-height, x-height, baseline, descender)
garamond=(“Garamond Premier Pro”)
tamanho=13
linha = (1, 1, 0)
yx = [120, 110, 104, 165, 115]
ycap = [ 65, 69, 65, 90, 73]
ya = [50, 68, 68, 53, 79]
yd = [270, 255, 255, 348, 249]
ybaseline= 212
# baseline
stroke(0,0,0)
strokewidth(1)
line(0, ybaseline, 594, ybaseline)
font(garamond, tamanho)
text(“baseline”, 20, ybaseline)
# x-height
stroke(linha)
strokewidth(1)
line(0, yx[indice], 594, yx[indice])
font(garamond, tamanho)
text(“x-height”, 20, yx[indice]+15)
# cap-height
stroke(linha)
strokewidth(1)
line(0, ycap[indice], 594, ycap[indice])
font(garamond, tamanho)
text(“cap-height”, 20, ycap[indice]+15)
# ascender
stroke(linha)
strokewidth(1)
line(0, ya[indice], 594, ya[indice])
font(garamond, tamanho)
text(“ascender”, 20, ya[indice])
# descender
stroke(linha)
strokewidth(1)
line(0, yd[indice], 594, yd[indice])
font(garamond, tamanho)
text(“descender”, 20, yd[indice])
# rectangulo do texto
nostroke()
fill (1, 1, 0)
rect(0, 560, 595, 185)
# modelo da frase : “The 1 2 3 jumps over the 4 5”
# listas da frase
primeiro = [“quick”, “slow”, “portuguese”, “ugly”, “stupid”]
segundo = [“brown”, “yellow”, “blue”, “red”, “green”]
terceiro = [“fox”, “chicken”, “whale”, “mouse”, “giraffe”]
quarto = [“lazy”, “cute”, “frozen”, “warm”, “annoying”]
quinto = [“eagle”, “octopus”, “flamingo”, “crab”, “elephant”]
# lista dos caracteres da fonte “lemodedevictor”
animais = [“=”, “d”, “D”, “W”, “R”,]
animaisdois= [“a”, “r”, “F”, “N”, “E”]
# variaveis
parte1 = choice(primeiro)
parte2 = choice(segundo)
parte3 = choice(terceiro)
parte4 = choice(quarto)
parte5 = choice(quinto)
frase = [“The %s %s” % (parte1, parte2),
” “,
“jumps over the”,
“%s” % (parte4),
” “]
# frases
for frase in frase:
fill(0)
translate(0, 30)
align(CENTER)
#font(choice(fonte), 35)
font(“Garamond Premier Pro”, 25)
text(frase, 115, 575, width=WIDTH)
reset()
# ligacao das palavras da lista “segundo”, com os caracteres/animais “animais”
align(CENTER)
font(“Garamond Premier Pro”, 25)
text(terceiro [indice], 115, 635, width=WIDTH)
nofill()
font(“lemondedevictor”, 40)
fill(0)
text(animais[indice], 80, 600)
reset()
# ligacao das palavras da lista “quinto”, com os caracteres/animais “animaisdois”
align(CENTER)
font(“Garamond Premier Pro”, 25)
text(quinto [indice], 115, 725, width=WIDTH)
nofill()
font(“lemondedevictor”, 30)
fill(0)
text(animaisdois[indice], 150, 730)