xfont

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 24, 2025 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

* @Author: wangjun [email protected] * @Date: 2024-07-08 16:38:10 * @LastEditors: wangjun [email protected] * @LastEditTime: 2024-07-09 11:24:35 * @FilePath: \golib\fontx\fontx.go * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Font

type Font struct {
	Style string //B,I,U  Bold Italic Underline
	// contains filtered or unexported fields
}

func New

func New(name string, fontData []byte) (m *Font, err error)

func NewFont

func NewFont(name string, path string) (m *Font, err error)

func (*Font) FontData

func (m *Font) FontData() []byte

func (*Font) GetFont

func (m *Font) GetFont() *truetype.Font

func (*Font) Height

func (m *Font) Height() int

func (*Font) LastSize

func (m *Font) LastSize() int

func (*Font) Lines

func (m *Font) Lines(text string, width int) (lines []string, height int)

按照固定长度换行

func (*Font) MeasureText

func (m *Font) MeasureText(text string) (width fixed.Int26_6, height int)

measureText 计算文本的宽度

func (*Font) Name

func (m *Font) Name() string

func (*Font) SetFont

func (m *Font) SetFont(f *truetype.Font)

func (*Font) SetSize

func (m *Font) SetSize(size int)

func (*Font) Size

func (m *Font) Size() int

Jump to

Keyboard shortcuts

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