Versions in this module Expand all Collapse all v0 v0.0.3 Apr 21, 2023 v0.0.2 Apr 28, 2022 Changes in this version + const AFCenterdBaseline + const AFIsEllipsis + const AFNeedHyphen + const MaxInt + const Scale + const ScaleLarge + const ScaleMedium + const ScaleSmall + const ScaleXLarge + const ScaleXsmall + const ScaleXxLarge + const ScaleXxsmall + var GravityMap = enumMap + var Identity = Matrix + var StretchMap = enumMap + var StyleMap = enumMap + func SampleString(lang Language) string + type Alignment uint8 + const ALIGN_CENTER + const ALIGN_LEFT + const ALIGN_RIGHT + type Analysis struct + ExtraAttrs AttrList + Flags uint8 + Font Font + Gravity Gravity + Language Language + Level fribidi.Level + Script Script + type AttrColor struct + Blue uint16 + Green uint16 + Red uint16 + func (a AttrColor) String() string + type AttrData interface + type AttrFloat Fl + func (a AttrFloat) String() string + type AttrInt int + func (a AttrInt) String() string + type AttrKind uint8 + const ATTR_ABSOLUTE_LINE_HEIGHT + const ATTR_ABSOLUTE_SIZE + const ATTR_ALLOW_BREAKS + const ATTR_BACKGROUND + const ATTR_BACKGROUND_ALPHA + const ATTR_BASELINE_SHIFT + const ATTR_FALLBACK + const ATTR_FAMILY + const ATTR_FONT_DESC + const ATTR_FONT_FEATURES + const ATTR_FONT_SCALE + const ATTR_FOREGROUND + const ATTR_FOREGROUND_ALPHA + const ATTR_GRAVITY + const ATTR_GRAVITY_HINT + const ATTR_INSERT_HYPHENS + const ATTR_INVALID + const ATTR_LANGUAGE + const ATTR_LETTER_SPACING + const ATTR_LINE_HEIGHT + const ATTR_OVERLINE + const ATTR_OVERLINE_COLOR + const ATTR_RISE + const ATTR_SCALE + const ATTR_SENTENCE + const ATTR_SHAPE + const ATTR_SHOW + const ATTR_SIZE + const ATTR_STRETCH + const ATTR_STRIKETHROUGH + const ATTR_STRIKETHROUGH_COLOR + const ATTR_STYLE + const ATTR_TEXT_TRANSFORM + const ATTR_UNDERLINE + const ATTR_UNDERLINE_COLOR + const ATTR_VARIANT + const ATTR_WEIGHT + const ATTR_WORD + func (t AttrKind) String() string + type AttrList []*Attribute + func (list *AttrList) Change(attr *Attribute) + func (list *AttrList) Filter(fn func(attr *Attribute) bool) AttrList + func (list *AttrList) Insert(attr *Attribute) + type AttrShape struct + func (a AttrShape) String() string + type AttrString string + func (a AttrString) String() string + type Attribute struct + Data AttrData + EndIndex int + Kind AttrKind + StartIndex int + func NewAttrAbsoluteLineHeight(height int) *Attribute + func NewAttrAbsoluteSize(size int) *Attribute + func NewAttrAllowBreaks(allowBreaks bool) *Attribute + func NewAttrBackground(color AttrColor) *Attribute + func NewAttrBackgroundAlpha(alpha uint16) *Attribute + func NewAttrBaselineShift(rise int) *Attribute + func NewAttrFallback(enableFallback bool) *Attribute + func NewAttrFamily(family string) *Attribute + func NewAttrFontDescription(desc FontDescription) *Attribute + func NewAttrFontFeatures(features string) *Attribute + func NewAttrFontScale(scale FontScale) *Attribute + func NewAttrForeground(color AttrColor) *Attribute + func NewAttrForegroundAlpha(alpha uint16) *Attribute + func NewAttrGravity(gravity Gravity) *Attribute + func NewAttrGravityHint(gravityHint GravityHint) *Attribute + func NewAttrInsertHyphens(insertHyphens bool) *Attribute + func NewAttrLanguage(language Language) *Attribute + func NewAttrLetterSpacing(letterSpacing int32) *Attribute + func NewAttrLineHeight(factor float32) *Attribute + func NewAttrOverline(overline Overline) *Attribute + func NewAttrOverlineColor(color AttrColor) *Attribute + func NewAttrRise(rise int) *Attribute + func NewAttrScale(scaleFactor Fl) *Attribute + func NewAttrSentence() *Attribute + func NewAttrShape(ink, logical Rectangle) *Attribute + func NewAttrShow(flags ShowFlags) *Attribute + func NewAttrSize(size int) *Attribute + func NewAttrStretch(stretch Stretch) *Attribute + func NewAttrStrikethrough(strikethrough bool) *Attribute + func NewAttrStrikethroughColor(color AttrColor) *Attribute + func NewAttrStyle(style Style) *Attribute + func NewAttrTextTransform(textTransform TextTransform) *Attribute + func NewAttrUnderline(underline Underline) *Attribute + func NewAttrUnderlineColor(color AttrColor) *Attribute + func NewAttrVariant(variant Variant) *Attribute + func NewAttrWeight(weight Weight) *Attribute + func NewAttrWord() *Attribute + func (attr Attribute) String() string + type BaselineShift uint8 + const BASELINE_SHIFT_NONE + const BASELINE_SHIFT_SUBSCRIPT + const BASELINE_SHIFT_SUPERSCRIPT + type CharAttr uint16 + const BackspaceDeletesCharacter + const BreakInsertsHyphen + const BreakRemovesPreceding + const CharBreak + const CursorPosition + const ExpandableSpace + const LineBreak + const MandatoryBreak + const SentenceBoundary + const SentenceEnd + const SentenceStart + const White + const WordBoundary + const WordEnd + const WordStart + func ComputeCharacterAttributes(text []rune, level fribidi.Level) []CharAttr + func (c CharAttr) IsBackspaceDeletesCharacter() bool + func (c CharAttr) IsBreakInsertsHyphen() bool + func (c CharAttr) IsBreakRemovesPreceding() bool + func (c CharAttr) IsCharBreak() bool + func (c CharAttr) IsCursorPosition() bool + func (c CharAttr) IsExpandableSpace() bool + func (c CharAttr) IsLineBreak() bool + func (c CharAttr) IsMandatoryBreak() bool + func (c CharAttr) IsSentenceBoundary() bool + func (c CharAttr) IsSentenceEnd() bool + func (c CharAttr) IsSentenceStart() bool + func (c CharAttr) IsWhite() bool + func (c CharAttr) IsWordBoundary() bool + func (c CharAttr) IsWordEnd() bool + func (c CharAttr) IsWordStart() bool + type Context struct + Matrix *Matrix + RoundGlyphPositions bool + func NewContext(fontmap FontMap) *Context + func (context *Context) GetLanguage() Language + func (context *Context) GetMetrics(desc *FontDescription, lang Language) FontMetrics + func (context *Context) Itemize(text []rune, startIndex int, length int, attrs AttrList) *ItemList + func (context *Context) SetBaseGravity(gravity Gravity) + func (context *Context) SetFontDescription(desc FontDescription) + func (context *Context) SetLanguage(language Language) + func (context *Context) SetRoundGlyphPositions(roundPositions bool) + type Coverage interface + Get func(index rune) bool + Set func(index rune, covered bool) + type CursorPos struct + type Direction uint8 + const DIRECTION_LTR + const DIRECTION_NEUTRAL + const DIRECTION_RTL + const DIRECTION_WEAK_LTR + const DIRECTION_WEAK_RTL + func (d Direction) String() string + type EllipsizeMode uint8 + const ELLIPSIZE_END + const ELLIPSIZE_MIDDLE + const ELLIPSIZE_NONE + const ELLIPSIZE_START + type Fl = float32 + type Font interface + Describe func(absolute bool) FontDescription + FaceID func() fonts.FaceID + GetCoverage func(language Language) Coverage + GetFeatures func() []harfbuzz.Feature + GetFontMap func() FontMap + GetHarfbuzzFont func() *harfbuzz.Font + GetMetrics func(language Language) FontMetrics + GlyphExtents func(glyph Glyph, inkRect, logicalRect *Rectangle) + func LoadFont(fontmap FontMap, context *Context, description *FontDescription) Font + type FontDescription struct + FamilyName string + Gravity Gravity + Size int32 + SizeIsAbsolute bool + Stretch Stretch + Style Style + Variant Variant + Variations string + Weight Weight + func NewFontDescription() FontDescription + func NewFontDescriptionFrom(str string) FontDescription + func (desc *FontDescription) SetAbsoluteSize(size int32) + func (desc *FontDescription) SetFamily(family string) + func (desc *FontDescription) SetGravity(gravity Gravity) + func (desc *FontDescription) SetSize(size int32) + func (desc *FontDescription) SetStretch(stretch Stretch) + func (desc *FontDescription) SetStyle(style Style) + func (desc *FontDescription) SetVariant(variant Variant) + func (desc *FontDescription) SetVariations(variations string) + func (desc *FontDescription) SetWeight(weight Weight) + func (desc *FontDescription) UnsetFields(toUnset FontMask) + func (desc FontDescription) AsHash() FontDescription + func (desc FontDescription) String() string + type FontMap interface + GetSerial func() uint + LoadFontset func(context *Context, desc *FontDescription, language Language) Fontset + type FontMask uint16 + const FmFamily + const FmGravity + const FmSize + const FmStretch + const FmStyle + const FmVariant + const FmVariations + const FmWeight + type FontMetrics struct + ApproximateCharWidth Unit + ApproximateDigitWidth Unit + Ascent Unit + Descent Unit + Height Unit + StrikethroughPosition Unit + StrikethroughThickness Unit + UnderlinePosition Unit + UnderlineThickness Unit + func FontGetMetrics(font Font, language Language) FontMetrics + type FontScale uint8 + const FONT_SCALE_NONE + const FONT_SCALE_SMALL_CAPS + const FONT_SCALE_SUBSCRIPT + const FONT_SCALE_SUPERSCRIPT + type Fontset interface + Foreach func(fn FontsetForeachFunc) + GetLanguage func() Language + type FontsetForeachFunc = func(font Font) bool + type Glyph uint32 + const GLYPH_EMPTY + const GLYPH_INVALID_INPUT + const GLYPH_UNKNOWN_FLAG + func AsUnknownGlyph(wc rune) Glyph + func (g Glyph) GID() fonts.GID + type GlyphGeometry struct + Width Unit + XOffset Unit + YOffset Unit + type GlyphInfo struct + Geometry GlyphGeometry + Glyph Glyph + type GlyphItem struct + Glyphs *GlyphString + Item *Item + func (g GlyphItem) LTR() bool + func (glyphItem *GlyphItem) GetLogicalWidths(text []rune) []Unit + type GlyphItemIter struct + EndChar int + EndIndex int + StartChar int + StartIndex int + func (iter *GlyphItemIter) InitEnd(glyphItem *GlyphItem, text []rune) bool + func (iter *GlyphItemIter) InitStart(glyphItem *GlyphItem, text []rune) bool + func (iter *GlyphItemIter) NextCluster() bool + func (iter *GlyphItemIter) PrevCluster() bool + type GlyphString struct + Glyphs []GlyphInfo + LogClusters []int + func (glyphs *GlyphString) Extents(font Font, inkRect, logicalRect *Rectangle) + func (glyphs *GlyphString) IndexToX(text []rune, analysis *Analysis, index int, trailing bool) Unit + func (glyphs *GlyphString) Shape(text []rune, analysis *Analysis) + func (glyphs *GlyphString) ShapeRange(paragraphText []rune, itemOffset, itemLength int, analysis *Analysis) + type Gravity uint8 + const GRAVITY_AUTO + const GRAVITY_EAST + const GRAVITY_NORTH + const GRAVITY_SOUTH + const GRAVITY_WEST + func (g Gravity) IsImproper() bool + func (g Gravity) IsVertical() bool + func (g Gravity) String() string + type GravityHint uint8 + const GRAVITY_HINT_LINE + const GRAVITY_HINT_NATURAL + const GRAVITY_HINT_STRONG + type Item struct + Analysis Analysis + Length int + Offset int + func (item *Item) Shape(paragraphText []rune, logAttrs []CharAttr, glyphs *GlyphString, ...) + type ItemList struct + Data *Item + Next *ItemList + func (items *ItemList) ApplyAttributes(attrs AttrList) + type Language = language.Language + func DefaultLanguage() Language + type Layout struct + Attributes AttrList + Height Unit + Indent Unit + Justify bool + JustifyLastLine bool + LineSpacing float32 + Spacing Unit + Text []rune + Width Unit + func NewLayout(context *Context) *Layout + func (layout *Layout) GetBaseline() Unit + func (layout *Layout) GetCharacterAttributes() []CharAttr + func (layout *Layout) GetCursorPos(index int, strongPos, weakPos *Rectangle) + func (layout *Layout) GetDirectionAt(index int) Direction + func (layout *Layout) GetExtents(inkRect, logicalRect *Rectangle) + func (layout *Layout) GetIter() *LayoutIter + func (layout *Layout) GetLine(line int) *LayoutLine + func (layout *Layout) GetLineCount() int + func (layout *Layout) GetLinesReadonly() []*LayoutLine + func (layout *Layout) GetSize() (Unit, Unit) + func (layout *Layout) IndexToPos(index int, pos *Rectangle) + func (layout *Layout) IsEllipsized() bool + func (layout *Layout) IsWrapped() bool + func (layout *Layout) MoveCursorVisually(strong bool, oldIndex, oldTrailing, direction int) (newIndex, newTrailing int) + func (layout *Layout) SetAlignment(alignment Alignment) + func (layout *Layout) SetAttributes(attrs AttrList) + func (layout *Layout) SetAutoDir(autoDir bool) + func (layout *Layout) SetEllipsize(ellipsize EllipsizeMode) + func (layout *Layout) SetFontDescription(desc *FontDescription) + func (layout *Layout) SetHeight(height Unit) + func (layout *Layout) SetIndent(indent Unit) + func (layout *Layout) SetJustify(justify bool) + func (layout *Layout) SetJustifyLastLine(justify bool) + func (layout *Layout) SetLineSpacing(factor float32) + func (layout *Layout) SetMarkup(markup []byte) error + func (layout *Layout) SetRunes(text []rune) + func (layout *Layout) SetSingleParagraphMode(setting bool) + func (layout *Layout) SetSpacing(spacing Unit) + func (layout *Layout) SetTabs(tabs *TabArray) + func (layout *Layout) SetText(text string) + func (layout *Layout) SetWidth(width Unit) + func (layout *Layout) SetWrap(wrap WrapMode) + type LayoutIter struct + Index int + func (iter *LayoutIter) GetBaseline() Unit + func (iter *LayoutIter) GetCharExtents() Rectangle + func (iter *LayoutIter) GetClusterExtents(inkRect, logicalRect *Rectangle) + func (iter *LayoutIter) GetLine() *LayoutLine + func (iter *LayoutIter) GetLineExtents(inkRect, logicalRect *Rectangle) + func (iter *LayoutIter) GetRun() *GlyphItem + func (iter *LayoutIter) GetRunExtents(inkRect, logicalRect *Rectangle) + func (iter *LayoutIter) IsAtLastLine() bool + func (iter *LayoutIter) NextChar() bool + func (iter *LayoutIter) NextCluster() bool + func (iter *LayoutIter) NextLine() bool + func (iter *LayoutIter) NextRun() bool + type LayoutLine struct + IsParagraphStart bool + Length int + ResolvedDir Direction + Runs *RunList + StartIndex int + func (line *LayoutLine) GetExtents(inkRect, logicalRect *Rectangle) (height Unit) + func (line *LayoutLine) GetXRanges(startIndex, endIndex int) []Unit + func (line *LayoutLine) IndexToX(index int, trailing bool) Unit + type Matrix struct + X0 Fl + Xx Fl + Xy Fl + Y0 Fl + Yx Fl + Yy Fl + func (matrix *Matrix) GetFontScaleFactors() (xscale, yscale Fl) + type Overline uint8 + const OVERLINE_NONE + const OVERLINE_SINGLE + type ParsedMarkup struct + AccelChar rune + Attr AttrList + Text []rune + func ParseMarkup(markupText []byte, accelMarker rune) (ParsedMarkup, error) + type Rectangle struct + Height Unit + Width Unit + X Unit + Y Unit + type RunList struct + Data *GlyphItem + Next *RunList + type Script = language.Script + type ShowFlags uint8 + const SHOW_IGNORABLES + const SHOW_LINE_BREAKS + const SHOW_NONE + const SHOW_SPACES + type Stretch uint8 + const STRETCH_CONDENSED + const STRETCH_EXPANDED + const STRETCH_EXTRA_CONDENSED + const STRETCH_EXTRA_EXPANDED + const STRETCH_NORMAL + const STRETCH_SEMI_CONDENSED + const STRETCH_SEMI_EXPANDED + const STRETCH_ULTRA_CONDENSED + const STRETCH_ULTRA_EXPANDED + type Style uint8 + const STYLE_ITALIC + const STYLE_NORMAL + const STYLE_OBLIQUE + type Tab struct + Alignment TabAlign + DecimalPoint rune + Location Unit + type TabAlign uint8 + const TAB_CENTER + const TAB_DECIMAL + const TAB_LEFT + const TAB_RIGHT + type TabArray struct + PositionsInPixels bool + Tabs []Tab + func (tabs *TabArray) Copy() *TabArray + type TextTransform uint8 + const TEXT_TRANSFORM_CAPITALIZE + const TEXT_TRANSFORM_LOWERCASE + const TEXT_TRANSFORM_NONE + const TEXT_TRANSFORM_UPPERCASE + type Underline uint8 + const UNDERLINE_DOUBLE + const UNDERLINE_DOUBLE_LINE + const UNDERLINE_ERROR + const UNDERLINE_ERROR_LINE + const UNDERLINE_LOW + const UNDERLINE_NONE + const UNDERLINE_SINGLE + const UNDERLINE_SINGLE_LINE + type Unit int32 + func (d Unit) Round() Unit + func (g Unit) Pixels() int32 + func (g Unit) PixelsCeil() int32 + func (g Unit) PixelsFloor() int32 + type Variant uint8 + const VARIANT_ALL_PETITE_CAPS + const VARIANT_ALL_SMALL_CAPS + const VARIANT_NORMAL + const VARIANT_PETITE_CAPS + const VARIANT_SMALL_CAPS + const VARIANT_TITLE_CAPS + const VARIANT_UNICASE + type Weight int + const WEIGHT_BOLD + const WEIGHT_BOOK + const WEIGHT_HEAVY + const WEIGHT_LIGHT + const WEIGHT_MEDIUM + const WEIGHT_NORMAL + const WEIGHT_SEMIBOLD + const WEIGHT_SEMILIGHT + const WEIGHT_THIN + const WEIGHT_ULTRABOLD + const WEIGHT_ULTRAHEAVY + const WEIGHT_ULTRALIGHT + type WrapMode uint8 + const WRAP_CHAR + const WRAP_WORD + const WRAP_WORD_CHAR