Documentation
¶
Index ¶
- Variables
- func EqualParagraphStyle(a, b *ParagraphStyle) bool
- func EqualSpanStyle(a, b *SpanStyle) bool
- func EqualTextStyle(a, b *TextStyle) bool
- func IsSpecifiedParagraphStyle(s *ParagraphStyle) bool
- func IsSpecifiedSpanStyle(s *SpanStyle) bool
- func IsSpecifiedTextStyle(s *TextStyle) bool
- func SameParagraphStyle(a, b *ParagraphStyle) bool
- func SameSpanStyle(a, b *SpanStyle) bool
- func SameTextStyle(a, b *TextStyle) bool
- func SemanticEqualParagraphStyle(a, b *ParagraphStyle) bool
- func SemanticEqualSpanStyle(a, b *SpanStyle) bool
- func SemanticEqualTextStyle(a, b *TextStyle) bool
- func StringParagraphStyle(s *ParagraphStyle) string
- func StringSpanStyle(s *SpanStyle) string
- func StringTextStyle(ts *TextStyle) string
- func ToGioFont(ts *TextStyle) gioFont.Font
- type ParaghStyleInterface
- type ParagraphStyle
- func CoalesceParagraphStyle(ptr, def *ParagraphStyle) *ParagraphStyle
- func CopyParagraphStyle(s *ParagraphStyle, options ...ParagraphStyleOption) *ParagraphStyle
- func LerpParagraphStyle(width, start, stop *ParagraphStyle, fraction float32) *ParagraphStyle
- func MergeParagraphStyle(a, b *ParagraphStyle) *ParagraphStyle
- func ParagraphStyleResolveDefaults(s *ParagraphStyle, direction unit.LayoutDirection) *ParagraphStyle
- func TakeOrElseParagraphStyle(s, def *ParagraphStyle) *ParagraphStyle
- type ParagraphStyleOption
- type SpanStyle
- func CoalesceSpanStyle(ptr, def *SpanStyle) *SpanStyle
- func CopySpanStyle(s *SpanStyle, options ...SpanStyleOption) *SpanStyle
- func LerpSpanStyle(width, start, stop *SpanStyle, fraction float32) *SpanStyle
- func MergeSpanStyle(a, b *SpanStyle) *SpanStyle
- func SpanStyleResolveDefaults(s *SpanStyle) *SpanStyle
- func TakeOrElseSpanStyle(s, def *SpanStyle) *SpanStyle
- func (s SpanStyle) Background() graphics.Color
- func (s SpanStyle) Color() graphics.Color
- func (s SpanStyle) FontFamily() font.FontFamily
- func (s SpanStyle) FontSize() unit.TextUnit
- func (s SpanStyle) FontStyle() font.FontStyle
- func (s SpanStyle) FontWeight() font.FontWeight
- func (s SpanStyle) LetterSpacing() unit.TextUnit
- func (s SpanStyle) Shadow() *graphics.Shadow
- func (s SpanStyle) TextDecoration() *style.TextDecoration
- type SpanStyleInterface
- type SpanStyleOption
- type TextShaper
- type TextStyle
- func CoalesceTextStyle(ptr, def *TextStyle) *TextStyle
- func CopyTextStyle(ts *TextStyle, options ...TextStyleOption) *TextStyle
- func MergeTextStyle(a, b *TextStyle) *TextStyle
- func TakeOrElseTextStyle(s, def *TextStyle) *TextStyle
- func TextStyleFromGioFont(gf gioFont.Font) *TextStyle
- func TextStyleFromOptions(options ...TextStyleOption) *TextStyle
- func TextStyleResolveDefaults(ts *TextStyle, direction unit.LayoutDirection) *TextStyle
- func (ts TextStyle) Alpha() float32
- func (ts TextStyle) Background() graphics.Color
- func (ts TextStyle) Color() graphics.Color
- func (ts TextStyle) FontFamily() font.FontFamily
- func (ts TextStyle) FontSize() unit.TextUnit
- func (ts TextStyle) FontStyle() font.FontStyle
- func (ts TextStyle) FontWeight() font.FontWeight
- func (ts TextStyle) LetterSpacing() unit.TextUnit
- func (ts TextStyle) LineBreak() style.LineBreak
- func (ts TextStyle) LineHeight() unit.TextUnit
- func (ts TextStyle) TextAlign() style.TextAlign
- func (ts TextStyle) TextDecoration() *style.TextDecoration
- func (ts TextStyle) TextDirection() style.TextDirection
- type TextStyleInterface
- type TextStyleOption
- func WithBackground(color graphics.Color) TextStyleOption
- func WithColor(color graphics.Color) TextStyleOption
- func WithFontFamily(family font.FontFamily) TextStyleOption
- func WithFontSize(size unit.TextUnit) TextStyleOption
- func WithFontStyle(style font.FontStyle) TextStyleOption
- func WithFontWeight(weight font.FontWeight) TextStyleOption
- func WithLetterSpacing(spacing unit.TextUnit) TextStyleOption
- func WithLineBreak(lineBreak style.LineBreak) TextStyleOption
- func WithLineHeight(lineHeight unit.TextUnit) TextStyleOption
- func WithShadow(shadow *graphics.Shadow) TextStyleOption
- func WithTextAlign(textAlign style.TextAlign) TextStyleOption
- func WithTextDecoration(decoration *style.TextDecoration) TextStyleOption
- func WithTextDirection(textDirection style.TextDirection) TextStyleOption
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultBackgroundColor = graphics.ColorTransparent
View Source
var DefaultColor = graphics.ColorBlack
View Source
var DefaultFontFamily = font.FontFamilyDefault
View Source
var DefaultFontSize = unit.Sp(14)
View Source
var DefaultFontStyle = font.FontStyleNormal
View Source
var DefaultFontWeight = font.FontWeightNormal
View Source
var DefaultLetterSpacing = unit.Sp(0)
View Source
var DefaultLineBreak = style.LineBreakParagraph
View Source
var DefaultLineHeight = unit.TextUnitUnspecified // TODO: Should this stay unspecified ?
View Source
var DefaultShadow = graphics.ShadowNone
View Source
var DefaultTextAlign = style.TextAlignStart
View Source
var DefaultTextDecoration = style.TextDecorationNone
Functions ¶
func EqualParagraphStyle ¶
func EqualParagraphStyle(a, b *ParagraphStyle) bool
func EqualSpanStyle ¶
func EqualTextStyle ¶
func IsSpecifiedParagraphStyle ¶
func IsSpecifiedParagraphStyle(s *ParagraphStyle) bool
func IsSpecifiedSpanStyle ¶
func IsSpecifiedTextStyle ¶
func SemanticEqualParagraphStyle ¶
func SemanticEqualParagraphStyle(a, b *ParagraphStyle) bool
Semantic equality (field-by-field, 20 ns)
func SemanticEqualSpanStyle ¶
Semantic equality (field-by-field, 20 ns)
func SemanticEqualTextStyle ¶
Semantic equality (field-by-field, 20 ns)
func StringParagraphStyle ¶
func StringParagraphStyle(s *ParagraphStyle) string
func StringSpanStyle ¶
func StringTextStyle ¶
Types ¶
type ParaghStyleInterface ¶
type ParagraphStyle ¶
type ParagraphStyle struct {
// contains filtered or unexported fields
}
var ParagraphStyleUnspecified *ParagraphStyle = &ParagraphStyle{ textAlign: style.TextAlignUnspecified, textDirection: style.TextDirectionUnspecified, lineHeight: unit.TextUnitUnspecified, lineBreak: style.LineBreakUnspecified, }
func CoalesceParagraphStyle ¶
func CoalesceParagraphStyle(ptr, def *ParagraphStyle) *ParagraphStyle
func CopyParagraphStyle ¶
func CopyParagraphStyle(s *ParagraphStyle, options ...ParagraphStyleOption) *ParagraphStyle
func LerpParagraphStyle ¶
func LerpParagraphStyle(width, start, stop *ParagraphStyle, fraction float32) *ParagraphStyle
func MergeParagraphStyle ¶
func MergeParagraphStyle(a, b *ParagraphStyle) *ParagraphStyle
func ParagraphStyleResolveDefaults ¶
func ParagraphStyleResolveDefaults(s *ParagraphStyle, direction unit.LayoutDirection) *ParagraphStyle
func TakeOrElseParagraphStyle ¶
func TakeOrElseParagraphStyle(s, def *ParagraphStyle) *ParagraphStyle
func (ParagraphStyle) LineBreak ¶
func (ps ParagraphStyle) LineBreak() style.LineBreak
func (ParagraphStyle) LineHeight ¶
func (ps ParagraphStyle) LineHeight() unit.TextUnit
func (ParagraphStyle) TextAlign ¶
func (ps ParagraphStyle) TextAlign() style.TextAlign
func (ParagraphStyle) TextDirection ¶
func (ps ParagraphStyle) TextDirection() style.TextDirection
type ParagraphStyleOption ¶
type ParagraphStyleOption func(*ParagraphStyle)
type SpanStyle ¶
type SpanStyle struct {
// contains filtered or unexported fields
}
var SpanStyleUnspecified *SpanStyle = &SpanStyle{ color: graphics.ColorUnspecified, fontSize: unit.TextUnitUnspecified, fontWeight: font.FontWeightUnspecified, fontStyle: font.FontStyleUnspecified, fontFamily: nil, letterSpacing: unit.TextUnitUnspecified, background: graphics.ColorUnspecified, textDecoration: nil, shadow: nil, }
func CoalesceSpanStyle ¶
func CopySpanStyle ¶
func CopySpanStyle(s *SpanStyle, options ...SpanStyleOption) *SpanStyle
func LerpSpanStyle ¶
func MergeSpanStyle ¶
func TakeOrElseSpanStyle ¶
func (SpanStyle) Background ¶
func (SpanStyle) FontFamily ¶
func (s SpanStyle) FontFamily() font.FontFamily
func (SpanStyle) FontWeight ¶
func (s SpanStyle) FontWeight() font.FontWeight
func (SpanStyle) LetterSpacing ¶
func (SpanStyle) TextDecoration ¶
func (s SpanStyle) TextDecoration() *style.TextDecoration
type SpanStyleInterface ¶
type SpanStyleOption ¶
type SpanStyleOption func(*SpanStyle)
type TextShaper ¶
type TextStyle ¶
type TextStyle struct {
// contains filtered or unexported fields
}
var TextStyleUnspecified *TextStyle = &TextStyle{ spanStyle: SpanStyleUnspecified, paragraphStyle: ParagraphStyleUnspecified, }
func CoalesceTextStyle ¶
func CopyTextStyle ¶
func CopyTextStyle(ts *TextStyle, options ...TextStyleOption) *TextStyle
func MergeTextStyle ¶
func TakeOrElseTextStyle ¶
func TextStyleFromGioFont ¶
TextStyleFromGioFont converts a gio font.Font to a TextStyle. This is useful for integrating with Gio's font system.
func TextStyleFromOptions ¶
func TextStyleFromOptions(options ...TextStyleOption) *TextStyle
func TextStyleResolveDefaults ¶
func TextStyleResolveDefaults(ts *TextStyle, direction unit.LayoutDirection) *TextStyle
func (TextStyle) Background ¶
func (TextStyle) FontFamily ¶
func (ts TextStyle) FontFamily() font.FontFamily
func (TextStyle) FontWeight ¶
func (ts TextStyle) FontWeight() font.FontWeight
func (TextStyle) LetterSpacing ¶
func (TextStyle) LineHeight ¶
func (TextStyle) TextDecoration ¶
func (ts TextStyle) TextDecoration() *style.TextDecoration
func (TextStyle) TextDirection ¶
func (ts TextStyle) TextDirection() style.TextDirection
type TextStyleInterface ¶
type TextStyleInterface interface {
Alpha() float32
Background() graphics.Color
Color() graphics.Color
FontFamily() font.FontFamily
FontSize() unit.TextUnit
FontStyle() font.FontStyle
FontWeight() font.FontWeight
LetterSpacing() unit.TextUnit
LineBreak() style.LineBreak
LineHeight() unit.TextUnit
TextAlign() style.TextAlign
TextDecoration() *style.TextDecoration
TextDirection() style.TextDirection
}
type TextStyleOption ¶
type TextStyleOption func(ts *TextStyle)
func WithBackground ¶
func WithBackground(color graphics.Color) TextStyleOption
func WithColor ¶
func WithColor(color graphics.Color) TextStyleOption
func WithFontFamily ¶
func WithFontFamily(family font.FontFamily) TextStyleOption
func WithFontSize ¶
func WithFontSize(size unit.TextUnit) TextStyleOption
func WithFontStyle ¶
func WithFontStyle(style font.FontStyle) TextStyleOption
func WithFontWeight ¶
func WithFontWeight(weight font.FontWeight) TextStyleOption
func WithLetterSpacing ¶
func WithLetterSpacing(spacing unit.TextUnit) TextStyleOption
func WithLineBreak ¶
func WithLineBreak(lineBreak style.LineBreak) TextStyleOption
func WithLineHeight ¶
func WithLineHeight(lineHeight unit.TextUnit) TextStyleOption
func WithShadow ¶
func WithShadow(shadow *graphics.Shadow) TextStyleOption
func WithTextAlign ¶
func WithTextAlign(textAlign style.TextAlign) TextStyleOption
func WithTextDecoration ¶
func WithTextDecoration(decoration *style.TextDecoration) TextStyleOption
func WithTextDirection ¶
func WithTextDirection(textDirection style.TextDirection) TextStyleOption
Source Files
¶
Click to show internal directories.
Click to hide internal directories.