Re-arrange platform-dependent code.

This commit is contained in:
gmp
2019-09-10 11:31:57 -04:00
parent 09859ca0a9
commit 2c4c708b3a
7 changed files with 75 additions and 67 deletions
@@ -11,12 +11,8 @@ import (
"golang.org/x/image/font/sfnt"
)
var (
regular *sfnt.Font
confDir string
)
func init() {
var err error
regular, err = sfnt.Parse(goregular.TTF)
if err != nil {
log(Fatal, "Cannot parse default font: ", err)
-5
View File
@@ -11,11 +11,6 @@ import (
"golang.org/x/image/font/sfnt"
)
var (
regular *sfnt.Font
confDir string
)
func setFont() error {
f, err := os.Open("/System/Library/Fonts/AppleSDGothicNeo.ttc")
if err != nil {
+4
View File
@@ -17,6 +17,8 @@ import (
"gioui.org/ui/measure"
"gioui.org/ui/text"
"golang.org/x/image/font/sfnt"
"github.com/fsnotify/fsnotify"
"gopkg.in/yaml.v2"
@@ -74,6 +76,8 @@ func main() {
}
var (
confDir string
regular *sfnt.Font
Config conf
l []passgo.Pass
mux sync.Mutex