mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 07:35:40 +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.
|
||||
type Font struct {
|
||||
// Typeface identifies a particular typeface design. The empty
|
||||
// string denotes the default typeface.
|
||||
Typeface string
|
||||
Typeface Typeface
|
||||
Variant Variant
|
||||
Size unit.Value
|
||||
Style Style
|
||||
// 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
|
||||
}
|
||||
|
||||
// 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
|
||||
|
||||
const (
|
||||
@@ -80,7 +86,8 @@ const (
|
||||
|
||||
const (
|
||||
Normal Weight = 400
|
||||
Bold Weight = 700
|
||||
Medium Weight = 500
|
||||
Bold Weight = 600
|
||||
)
|
||||
|
||||
func (a Alignment) String() string {
|
||||
|
||||
Reference in New Issue
Block a user