text

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2024 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Alignment

type Alignment = gtext.Alignment

设置文本对齐

const (
	// 开始方向
	Start Alignment = iota
	// 结束方向
	End
	// 中间方向
	Middle
)

type InputHint

type InputHint = gkey.InputHint

InputHint 定义了屏幕键盘的类型,也就是给出了用户可能要输入的数据类型的提示。

const (
	// HintAny 表示期待任何类型的输入。
	HintAny InputHint = iota
	// HintText 表示期待文本输入。它可能会激活自动修正和建议。
	HintText
	// HintNumeric 表示期待数字输入。它可能会激活0-9、"."和","的快捷方式。
	HintNumeric
	// HintEmail 表示期待电子邮件输入。它可能会激活常用的电子邮件字符的快捷方式,如"@"和".com"。
	HintEmail
	// HintURL 表示期待URL输入。它可能会激活常见的URL片段的快捷方式,如"/"和".com"。
	HintURL
	// HintTelephone 表示期待电话号码输入。它可能会激活0-9、"#"和"*"的快捷方式。
	HintTelephone
	// HintPassword 表示期待密码输入。它可能会禁用自动修正并启用密码自动填充。
	HintPassword
)

type Weight

type Weight = gfont.Weight

Weight 类型定义了字体的粗细程度,其底层类型是 gfont.Weight

const (
	// Thin 代表极细字体,值为-300
	Thin Weight = -300
	// ExtraLight 代表超轻字体,值为-200
	ExtraLight Weight = -200
	// Light 代表轻字体,值为-100
	Light Weight = -100
	// Normal 代表正常字体,值为0
	Normal Weight = 0
	// Medium 代表中等字体,值为100
	Medium Weight = 100
	// SemiBold 代表半粗字体,值为200
	SemiBold Weight = 200
	// Bold 代表粗字体,值为300
	Bold Weight = 300
	// ExtraBold 代表超粗字体,值为400
	ExtraBold Weight = 400
	// Black 代表最粗的字体,值为500
	Black Weight = 500
)

这里定义了一些常用的字体粗细等级常量

type WrapPolicy

type WrapPolicy = gtext.WrapPolicy

WrapPolicy 就像是一本故事书,告诉我们如何正确地把一个长长的故事分成一页一页的小故事。

const (
	// WrapHeuristically 就像是我们在读故事的时候,尽量让每个单词都完整的出现在一页上。
	// 只有当一个单词太长,无法完整的出现在一页上时,我们才会把它分开。
	// 而且,如果一页的最后一个单词被截断了,我们会尽量让更多的字母保留在这一页。
	WrapHeuristically WrapPolicy = iota
	// WrapWords 就是我们坚决不允许一个单词被分开出现在两页上。就算这样做会让某个单词超出页面。
	WrapWords
	// WrapGraphemes 就是我们为了让每一页都尽量多的包含文字,不惜牺牲阅读的流畅性,
	// 在任何地方都可能把一个单词分开。
	WrapGraphemes
)

Jump to

Keyboard shortcuts

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