aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2015-05-14 21:32:16 +0200
committerDimitri Sokolyuk <demon@dim13.org>2015-05-14 21:32:16 +0200
commit8d2c66c04c5707ed0c75371946c758ddf4fd47db (patch)
tree1143b9fda63ed4966bcc2512b6e49ed9d7762af6
parentd5d7d91ccbc70bd68c9c2f218505af6b74fbb7a8 (diff)
print alphabet
-rw-r--r--main.go18
1 files changed, 12 insertions, 6 deletions
diff --git a/main.go b/main.go
index 6492d3c..7e65b9d 100644
--- a/main.go
+++ b/main.go
@@ -21,22 +21,28 @@ var selector = map[string]string{
"Roman Complex Small": "romancs.hmp",
"Roman Duplex": "romand.hmp",
"Roman Plain": "romanp.hmp",
- */
"Roman Simplex": "romans.hmp",
- /*
"Roman Triplex": "romant.hmp",
*/
+ "Roman Simplex": "romans.hmp",
}
func main() {
fnt := loadFont("data/hershey")
+ var x, y int
- for k, v := range selector {
- fmt.Println(k)
+ for _, v := range selector {
m := getMap("data/" + v)
- for k, gl := range fnt.Select(m) {
- fmt.Println(string(k), gl)
+ f := fnt.Select(m)
+ for i := 32; i < 128; i++ {
+ gl := f[rune(i)]
+ if y + gl.W >= 4000 {
+ y = 0
+ x += 200
+ }
+ fmt.Printf("^%d,%d,%s", x, y, gl)
+ y += gl.W
}
}
}