generated from mwc/problemset_typeface
Made letter D and also changed E to match fonts
For the Letter D, I experimented with using a curve. I first tried the circle function, but it was making the circle and arc too large, so I then looked to see if there was an oval function. After I wasn't able to find one I realized that I could just make the base of the letter longer and then use half a circle and it would still look like the letter D. For this letter, I made a function to draw the arc and then ran it twice, once for the outer part of the letter and once for the inner part. Once running the proof, I thought the E looked too thick, so I also changed the height of each part of the E to make it match the other letters.
This commit is contained in:
parent
8ec58ebc44
commit
2eba3d48c1
47
typeface.py
47
typeface.py
|
@ -14,7 +14,10 @@ from math import sqrt
|
|||
from math import atan
|
||||
from math import degrees
|
||||
|
||||
|
||||
def fly(distance):
|
||||
penup()
|
||||
forward(distance)
|
||||
pendown()
|
||||
|
||||
def draw_letter_a(unit):
|
||||
outer_angle = degrees(atan((3*unit)/(8*unit))) #defines outer angle turns in degrees
|
||||
|
@ -66,29 +69,49 @@ def draw_letter_b(unit):
|
|||
def draw_letter_c(unit):
|
||||
pass
|
||||
|
||||
def draw_letter_d(unit):
|
||||
pass
|
||||
|
||||
|
||||
def draw_letter_d(unit): #makes the arc part of the letter D for both outer and inner parts
|
||||
def d_arc(size_factor): #size_factor is the size of the arc part of the D
|
||||
forward(0.5*size_factor)
|
||||
circle(0.5*size_factor,180)
|
||||
forward(0.5*size_factor)
|
||||
left(90)
|
||||
forward(size_factor)
|
||||
|
||||
d_arc(8*unit)
|
||||
left(90)
|
||||
fly(unit)
|
||||
left(90)
|
||||
fly(unit)
|
||||
right(90)
|
||||
d_arc(6*unit)
|
||||
fly(unit)
|
||||
right(90)
|
||||
fly(unit)
|
||||
right(180)
|
||||
|
||||
|
||||
def draw_letter_e(unit):
|
||||
forward(8*unit)
|
||||
left(90)
|
||||
forward(1.5*unit)
|
||||
forward(1*unit)
|
||||
left(90)
|
||||
forward(6.5*unit)
|
||||
forward(7*unit)
|
||||
right(90)
|
||||
forward(1.75*unit)
|
||||
forward(2.5*unit)
|
||||
right(90)
|
||||
forward(6.5*unit)
|
||||
forward(7*unit)
|
||||
left(90)
|
||||
forward(1.5*unit)
|
||||
forward(1*unit)
|
||||
left(90)
|
||||
forward(6.5*unit)
|
||||
forward(7*unit)
|
||||
right(90)
|
||||
forward(1.75*unit)
|
||||
forward(2.5*unit)
|
||||
right(90)
|
||||
forward(6.5*unit)
|
||||
forward(7*unit)
|
||||
left(90)
|
||||
forward(1.5*unit)
|
||||
forward(1*unit)
|
||||
left(90)
|
||||
forward(8*unit)
|
||||
left(90)
|
||||
|
|
Loading…
Reference in New Issue