freetype: update log to s/Stderr/Println/.

R=r, nigeltao_gnome, adg
CC=golang-dev
http://codereview.appspot.com/2527041
This commit is contained in:
Nigel Tao 2010-10-15 14:02:11 +11:00
parent 220b691d5c
commit 18fe7866b3
5 changed files with 18 additions and 18 deletions

View File

@ -69,12 +69,12 @@ func main() {
// Read the font data.
fontBytes, err := ioutil.ReadFile(*fontfile)
if err != nil {
log.Stderr(err)
log.Println(err)
return
}
font, err := freetype.ParseFont(fontBytes)
if err != nil {
log.Stderr(err)
log.Println(err)
return
}
@ -106,7 +106,7 @@ func main() {
for _, s := range text {
_, err = c.DrawString(s, pt)
if err != nil {
log.Stderr(err)
log.Println(err)
return
}
pt.Y += c.PointToFix32(*size * *spacing)
@ -115,19 +115,19 @@ func main() {
// Save that RGBA image to disk.
f, err := os.Open("out.png", os.O_CREAT|os.O_WRONLY, 0600)
if err != nil {
log.Stderr(err)
log.Println(err)
os.Exit(1)
}
defer f.Close()
b := bufio.NewWriter(f)
err = png.Encode(b, rgba)
if err != nil {
log.Stderr(err)
log.Println(err)
os.Exit(1)
}
err = b.Flush()
if err != nil {
log.Stderr(err)
log.Println(err)
os.Exit(1)
}
fmt.Println("Wrote out.png OK.")

View File

@ -68,19 +68,19 @@ func main() {
// Save that RGBA image to disk.
f, err := os.Open("out.png", os.O_CREAT|os.O_WRONLY, 0600)
if err != nil {
log.Stderr(err)
log.Println(err)
os.Exit(1)
}
defer f.Close()
b := bufio.NewWriter(f)
err = png.Encode(b, rgba)
if err != nil {
log.Stderr(err)
log.Println(err)
os.Exit(1)
}
err = b.Flush()
if err != nil {
log.Stderr(err)
log.Println(err)
os.Exit(1)
}
fmt.Println("Wrote out.png OK.")

View File

@ -155,19 +155,19 @@ func main() {
// Save that RGBA image to disk.
f, err := os.Open("out.png", os.O_CREAT|os.O_WRONLY, 0600)
if err != nil {
log.Stderr(err)
log.Println(err)
os.Exit(1)
}
defer f.Close()
b := bufio.NewWriter(f)
err = png.Encode(b, rgba)
if err != nil {
log.Stderr(err)
log.Println(err)
os.Exit(1)
}
err = b.Flush()
if err != nil {
log.Stderr(err)
log.Println(err)
os.Exit(1)
}
fmt.Println("Wrote out.png OK.")

View File

@ -80,19 +80,19 @@ func main() {
// Save that RGBA image to disk.
f, err := os.Open("out.png", os.O_CREAT|os.O_WRONLY, 0600)
if err != nil {
log.Stderr(err)
log.Println(err)
os.Exit(1)
}
defer f.Close()
b := bufio.NewWriter(f)
err = png.Encode(b, m)
if err != nil {
log.Stderr(err)
log.Println(err)
os.Exit(1)
}
err = b.Flush()
if err != nil {
log.Stderr(err)
log.Println(err)
os.Exit(1)
}
fmt.Println("Wrote out.png OK.")

View File

@ -43,12 +43,12 @@ func main() {
fmt.Printf("Loading fontfile %q\n", *fontfile)
b, err := ioutil.ReadFile(*fontfile)
if err != nil {
log.Stderr(err)
log.Println(err)
return
}
font, err := truetype.Parse(b)
if err != nil {
log.Stderr(err)
log.Println(err)
return
}
printBounds(font.Bounds())
@ -61,7 +61,7 @@ func main() {
g := truetype.NewGlyphBuf()
err = g.Load(font, i0)
if err != nil {
log.Stderr(err)
log.Println(err)
return
}
fmt.Printf("'%c' glyph\n", c0)