This initially supports reading two common system fonts. At some point there should be a more general Open function, but first I need to work out how to to turn font names into android file names. Fixes golang/go#9419. Change-Id: I8321df873315a5222c39dccf961f742f2e2a7a4c Reviewed-on: https://go-review.googlesource.com/2059 Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
18 lines
447 B
Go
18 lines
447 B
Go
// Copyright 2014 The Go Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
// +build !android
|
|
|
|
package font
|
|
|
|
import "io/ioutil"
|
|
|
|
func buildDefault() ([]byte, error) {
|
|
return ioutil.ReadFile("/usr/share/fonts/truetype/droid/DroidSans.ttf")
|
|
}
|
|
|
|
func buildMonospace() ([]byte, error) {
|
|
return ioutil.ReadFile("/usr/share/fonts/truetype/droid/DroidSansMono.ttf")
|
|
}
|