goTypeface

package module
v0.0.0-...-619834b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 14, 2023 License: Artistic-2.0 Imports: 5 Imported by: 0

README

使用方式

go get gitee.com/grafies/goTypeface

代码演示

package main

import (
	"fyne.io/fyne/v2/app"
	"fyne.io/fyne/v2/widget"
	"gitee.com/grafies/goTypeface"
)

func main() {
	a := app.New()                          //创建一个fyne应用
	a.Settings().SetTheme(&goTypeface.GoTypeface{}) //引入字体,让程序可以显示中文,使用的是黑体
	w := a.NewWindow("\\(@^0^@)/")          //创建一个窗口的名称
	w.SetContent(widget.NewLabel("hello"))  //窗口内容
	w.ShowAndRun()                          //显示窗口
}

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	//go:embed fonts/simhei.ttf
	NotoSansSC []byte
)

声明静态资源,在打包的时候导入到包里面

Functions

This section is empty.

Types

type GoTypeface

type GoTypeface struct{}

func (*GoTypeface) Color

func (*GoTypeface) Color(n fyne.ThemeColorName, v fyne.ThemeVariant) color.Color

func (GoTypeface) Font

func (m GoTypeface) Font(fyne.TextStyle) fyne.Resource

Font StaticName 为 fonts 目录下的 ttf 类型的字体文件名

func (*GoTypeface) Icon

func (*GoTypeface) Icon(n fyne.ThemeIconName) fyne.Resource

func (*GoTypeface) Size

func (*GoTypeface) Size(n fyne.ThemeSizeName) float32

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL