mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-06 01:45:36 +00:00
text: match Bold weight to CSS, add Variant and Typeface
This commit is contained in:
+11
-4
@@ -50,9 +50,8 @@ type Weight int
|
|||||||
|
|
||||||
// Font specify a particular typeface, style and size.
|
// Font specify a particular typeface, style and size.
|
||||||
type Font struct {
|
type Font struct {
|
||||||
// Typeface identifies a particular typeface design. The empty
|
Typeface Typeface
|
||||||
// string denotes the default typeface.
|
Variant Variant
|
||||||
Typeface string
|
|
||||||
Size unit.Value
|
Size unit.Value
|
||||||
Style Style
|
Style Style
|
||||||
// Weight is the text weight. If zero, Normal is used instead.
|
// Weight is the text weight. If zero, Normal is used instead.
|
||||||
@@ -65,6 +64,13 @@ type Face interface {
|
|||||||
Shape(ppem fixed.Int26_6, str String) paint.ClipOp
|
Shape(ppem fixed.Int26_6, str String) paint.ClipOp
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Typeface identifies a particular typeface design. The empty
|
||||||
|
// string denotes the default typeface.
|
||||||
|
type Typeface string
|
||||||
|
|
||||||
|
// Variant denotes a typeface variant such as "Mono" or "Smallcaps".
|
||||||
|
type Variant string
|
||||||
|
|
||||||
type Alignment uint8
|
type Alignment uint8
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@@ -80,7 +86,8 @@ const (
|
|||||||
|
|
||||||
const (
|
const (
|
||||||
Normal Weight = 400
|
Normal Weight = 400
|
||||||
Bold Weight = 700
|
Medium Weight = 500
|
||||||
|
Bold Weight = 600
|
||||||
)
|
)
|
||||||
|
|
||||||
func (a Alignment) String() string {
|
func (a Alignment) String() string {
|
||||||
|
|||||||
Reference in New Issue
Block a user