Re-arrange platform-dependent code.
This commit is contained in:
@@ -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)
|
||||
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user