From 054700bf7efb8a346f13e59b10afca3cade3dc52 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Thu, 14 May 2015 21:44:29 +0200 Subject: Sort fonts --- main.go | 55 +++++++++++++++++++++++++------------------------------ 1 file changed, 25 insertions(+), 30 deletions(-) diff --git a/main.go b/main.go index 7e65b9d..149537e 100644 --- a/main.go +++ b/main.go @@ -3,46 +3,41 @@ package main import "fmt" var selector = map[string]string{ - /* - "Gothic English Triplex": "gothgbt.hmp", - "Gothic German Triplex": "gothgrt.hmp", - "Gothic Italian Triplex": "gothitt.hmp", - "Greek Complex": "greekc.hmp", - "Greek Complex Small": "greekcs.hmp", - "Greek Plain": "greekp.hmp", - "Greek Simplex": "greeks.hmp", - "Cyrillic Complex": "cyrilc.hmp", - "Italic Complex": "italicc.hmp", - "Italic Complex Small": "italiccs.hmp", - "Italic Triplex": "italict.hmp", - "Script Complex": "scriptc.hmp", - "Script Simplex": "scripts.hmp", - "Roman Complex": "romanc.hmp", - "Roman Complex Small": "romancs.hmp", - "Roman Duplex": "romand.hmp", "Roman Plain": "romanp.hmp", "Roman Simplex": "romans.hmp", + "Roman Duplex": "romand.hmp", + "Roman Complex": "romanc.hmp", + "Roman Complex Small": "romancs.hmp", "Roman Triplex": "romant.hmp", - */ - "Roman Simplex": "romans.hmp", + "Script Simplex": "scripts.hmp", + "Script Complex": "scriptc.hmp", + "Italic Complex": "italicc.hmp", + "Italic Complex Small": "italiccs.hmp", + "Italic Triplex": "italict.hmp", + "Greek Plain": "greekp.hmp", + "Greek Simplex": "greeks.hmp", + "Greek Complex": "greekc.hmp", + "Greek Complex Small": "greekcs.hmp", + "Cyrillic Complex": "cyrilc.hmp", + "Gothic English Triplex": "gothgbt.hmp", + "Gothic German Triplex": "gothgrt.hmp", + "Gothic Italian Triplex": "gothitt.hmp", } func main() { fnt := loadFont("data/hershey") var x, y int - for _, v := range selector { - m := getMap("data/" + v) + m := getMap("data/" + selector["Roman Simplex"]) - 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 + 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 } } -- cgit v1.2.3