From 2eba3d48c1829f2570513f702a73e75f63e8e80d Mon Sep 17 00:00:00 2001 From: Chris Mekelburg Date: Sat, 21 Sep 2024 12:41:45 -0400 Subject: [PATCH] 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. --- typeface.py | 47 +++++++++++++++++++++++++++++++++++------------ 1 file changed, 35 insertions(+), 12 deletions(-) diff --git a/typeface.py b/typeface.py index 9e79f3e..c2e3d2d 100644 --- a/typeface.py +++ b/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)