fyne font example
1.0.0
ภาษาอังกฤษ / 日本語
แอปพลิเคชันตัวอย่างที่ใช้แบบอักษรที่แตกต่างกันใน FYNE
สำคัญ
นี่คือคำอธิบายสำหรับ fyne v2.x หากคุณต้องการทราบ Fyne v1.x หรือก่อนหน้านี้โปรดดูที่ไดเรกทอรี V1

เคล็ดลับ
- ชอบทำงานกับ GUI หรือไม่? ลอง Fyne-theme-Generator!
fyne $ go get fyne.io/fyne/v2/cmd/fyne
$ fyne
Usage: fyne [command] [parameters], where command is one of:
...
fyne bundle $ fyne bundle mplus-1c-regular.ttf > bundle.go
$ head -n 9 bundle.go
// auto-generated
package main
import "fyne.io/fyne/v2"
var resourceMplus1cRegularTtf = &fyne.StaticResource{
StaticName: "mplus-1c-regular.ttf",
StaticContent: []byte{
ดู ./v2/bundle.go
คำเตือน
ขนาดไฟล์มีขนาดใหญ่มาก
type myTheme struct {}
func ( * myTheme ) Font ( s fyne. TextStyle ) fyne. Resource {
if s . Monospace {
return theme . DefaultTheme (). Font ( s )
}
if s . Bold {
if s . Italic {
return theme . DefaultTheme (). Font ( s )
}
return resourceMplus1cBoldTtf
}
if s . Italic {
return theme . DefaultTheme (). Font ( s )
}
return resourceMplus1cRegularTtf
}
...ดู ./v2/theme.go
...
a := app . New ()
a . Settings (). SetTheme ( & myTheme {})
...ดู ./v2/main.go
bundle.go ถูกสร้างขึ้นโดยใช้คำสั่ง fyne
$ fyne bundle mplus-1c-regular.ttf > bundle.go
$ fyne bundle -append mplus-1c-bold.ttf >> bundle.go
ดูบล็อกด้านล่างสำหรับข้อมูลเพิ่มเติม (ญี่ปุ่น)
fyneนอกจากนี้ยังมีการเพิ่มบทช่วยสอนอย่างเป็นทางการในการรวมกลุ่มทรัพยากร
M+ ฟอนต์รวมอยู่และใช้เป็นไฟล์ตัวอย่างตัวอย่าง
https://mplusfonts.github.io