runemanip

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 13, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	OverrideWidthMSPMin, OverrideWidthMSPMax             rune // Miscellaneous Symbols and Pictographs
	OverrideWidthSSPMin, OverrideWidthSSPMax             rune // Supplemental Symbols and Pictographs
	OverrideWidthEmoticonsMin, OverrideWidthEmoticonsMax rune // Emoticons
)

We need block info from unicode, which depends upon us. Bleh. NOTE: this means that testing this requires importing unicode too, so the tests are elsewhere. Eww.

Functions

func DisplayCellWidth

func DisplayCellWidth(s string) (width int, isOverride bool)

DisplayCellWidth is a best-guess at how many "terminal grid cells" wide a character is The actual calculations are done by the table layer; our preferred table layer (tabular; because we wrote it and it's better) uses github.com/mattn/go-runewidth and this same function.

func HexDecodeArgs

func HexDecodeArgs(in []string) (out []string, errList []error)

HexDecodeArgs decodes hex strings passed in argv, returning new args.

func IsPairCode

func IsPairCode(r rune) bool

IsPairCode indicates if the passed run is part of a pairing code designed for extensible lookup. This is used for national flags. Eg, [0x1F1FA 0x1F1F8] = [<Regional Indicator U> <Regional Indicator S>] = 🇺🇸 which will display in some contexts as the flag of the USA.

func IsVariationSelector added in v0.6.2

func IsVariationSelector(r rune) bool

func RuneFromHexField

func RuneFromHexField(bb []byte) rune

RuneFromHexField converts a hex field, perhaps of odd length, to a rune

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL