cmd/tailscale: switch to the Roboto font

Updates tailscale/tailscale#420

Signed-off-by: Elias Naur <mail@eliasnaur.com>
pull/2/head
Elias Naur 4 years ago
parent 08c2192240
commit 4388f145cc

@ -13,7 +13,7 @@ import (
"time"
"gioui.org/f32"
"gioui.org/font/gofont"
"gioui.org/font/opentype"
"gioui.org/io/pointer"
"gioui.org/io/system"
"gioui.org/layout"
@ -28,6 +28,8 @@ import (
"tailscale.com/ipn"
"tailscale.com/tailcfg"
"eliasnaur.com/font/roboto/robotoregular"
_ "image/png"
)
@ -120,8 +122,15 @@ func newUI(store *stateStore) (*UI, error) {
if err != nil {
return nil, err
}
//fonts := gofont.Collection()
fonts := new(text.Collection)
face, err := opentype.Parse(robotoregular.TTF)
if err != nil {
panic(fmt.Sprintf("failed to parse font: %v", err))
}
fonts.Register(text.Font{Typeface: "Roboto"}, face)
ui := &UI{
theme: material.NewTheme(gofont.Collection()),
theme: material.NewTheme(fonts),
store: store,
}
ui.intro.show, _ = store.ReadBool(keyShowIntro, true)

@ -3,6 +3,7 @@ module tailscale.com/tailscale-android
go 1.14
require (
eliasnaur.com/font v0.0.0-20200617114307-e02d32decb4b
gioui.org v0.0.0-20200617094714-596e32161041
gioui.org/cmd v0.0.0-20200530141830-d2c67cdf8039
github.com/tailscale/wireguard-go v0.0.0-20200515231107-62868271d710

@ -1,5 +1,7 @@
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
eliasnaur.com/font v0.0.0-20200617114307-e02d32decb4b h1:J9r7EuPdhvBTafg34EqrObAm/bDEaDh7LvhKJPGficE=
eliasnaur.com/font v0.0.0-20200617114307-e02d32decb4b/go.mod h1:CYwJpIhpzVfoHpFXGlXjSx9mXMWtHt4XXmZb6RjumRc=
gioui.org v0.0.0-20200530124200-1377bea3cdc5/go.mod h1:AHI9rFr6AEEHCb8EPVtb/p5M+NMJRKH58IOp8O3Je04=
gioui.org v0.0.0-20200617094714-596e32161041 h1:mogSEMG8m1oAoF9kc7s0ABUkqZK6wq6rswSUCTbqhVs=
gioui.org v0.0.0-20200617094714-596e32161041/go.mod h1:AHI9rFr6AEEHCb8EPVtb/p5M+NMJRKH58IOp8O3Je04=

Loading…
Cancel
Save