func makeFont(t testing.TB, ttf string) *truetype.Font { // TODO we should probably bundle fonts in testdata font, err := truetype.Open(ttf) if err != nil { t.Fatalf("cannot load font: %v", err) } return font }
// New returns a new instance of the plugin. func (Clock) New(state *quobar.State) (quobar.Drawer, error) { font, err := truetype.Open(state.Config.FontPath) if err != nil { return nil, err } p := &clock{ state: state, font: font, } return p, nil }