Explorar o código

Update font output.

Steve Thielemann hai 1 ano
pai
achega
7971672197
Modificáronse 1 ficheiros con 13 adicións e 6 borrados
  1. 13 6
      testdoor/testdoor.go

+ 13 - 6
testdoor/testdoor.go

@@ -310,7 +310,7 @@ func font_demo(d *door.Door) {
 	d.Write(door.CRNL)
 
 	fac.Modify(1, patch)
-	output, l = fac.Output(now.Format("Janunary")) // 3:04:05 PM"))
+	output, l = fac.Output(now.Format("January")) // 3:04:05 PM"))
 	centering = strings.Repeat(" ", (door.Width-l)/2)
 	for _, o := range output {
 		d.Write(fmt.Sprintf("%s%s%s", centering, o, door.Reset) + door.CRNL)
@@ -320,11 +320,7 @@ func font_demo(d *door.Door) {
 
 	// Anarchy Blue - no digits
 	var fab door.ColorFont = FontSerpent()
-	now = time.Now()
-	output, l = fab.Output(now.Format("01/02/2006"))
-	if l > door.Width {
-		output, l = fab.Output("Hello")
-	}
+	output, l = fab.Output("Date/Time:")
 
 	if l < door.Width {
 		centering = strings.Repeat(" ", (door.Width-l)/2)
@@ -336,6 +332,17 @@ func font_demo(d *door.Door) {
 	}
 
 	var unchain door.ColorFont = FontUnchained()
+	now = time.Now()
+	output, l = unchain.Output(now.Format("01/02/2006"))
+	if l < door.Width {
+		centering = strings.Repeat(" ", (door.Width-l)/2)
+
+		for _, o := range output {
+			d.Write(centering + o + door.Reset + door.CRNL)
+		}
+		d.Write(door.CRNL)
+	}
+
 	output, l = unchain.Output(now.Format("3:04:05 PM"))
 	if l > door.Width {
 		output, l = unchain.Output("Meow")