From d33461dd80fffa3497e31e21a25c7b92a3ede989 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Sun, 13 Oct 2019 18:22:31 +0200 Subject: [PATCH] text: match Bold weight to CSS, add Variant and Typeface --- text/text.go | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/text/text.go b/text/text.go index 187d8314..a9c001c3 100644 --- a/text/text.go +++ b/text/text.go @@ -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 {