Documentation
¶
Overview ¶
Package repertoire provides the graphics repertoire for VT220 terminals. It defines GraphicSet which pairs a character encoding with its DSCS (Designate Character Set) identifier, and provides the standard VT220 character sets pre-configured.
Index ¶
Constants ¶
const ( // DSCSAscii is 'B' - ASCII graphic set DSCSAscii = codetable.C04R02 // DSCSSupplemental is '<' - DEC Supplemental Graphics DSCSSupplemental = codetable.C03R12 // DSCSSpecialGraphics is '0' - DEC Special Graphics DSCSSpecialGraphics = codetable.C03R00 // DSCSBritish is 'A' - British NRC DSCSBritish = codetable.C04R01 // DSCSDutch is '4' - Dutch NRC DSCSDutch = codetable.C03R04 // DSCSFinnish is 'C' - Finnish NRC // It could also be '5' (C03R05) as both are supported, but we'll use the first option. DSCSFinnish = codetable.C04R03 // DSCSFrench is 'R' - French NRC DSCSFrench = codetable.C05R02 // DSCSFrenchCanadian is 'Q' - French Canadian NRC DSCSFrenchCanadian = codetable.C05R01 // DSCSGerman is 'K' - German NRC DSCSGerman = codetable.C04R11 // DSCSItalian is 'Y' - Italian NRC DSCSItalian = codetable.C05R09 // DSCSNorwegianDanish is 'E' - Norwegian/Danish NRC // It could also be '6' (C03R06) as both are supported, but we'll use the first option. DSCSNorwegianDanish = codetable.C04R05 // DSCSSpanish is 'Z' - Spanish NRC DSCSSpanish = codetable.C05R10 // DSCSSwedish is 'H' - Swedish NRC // It could also be '7' (C03R07) as both are supported, but we'll use the first option. DSCSSwedish = codetable.C04R08 // DSCSSwiss is '=' - Swiss NRC DSCSSwiss = codetable.C03R13 )
DSCS Final bytes for standard VT220 character sets. These are the final characters in Select Character Set sequences.
Variables ¶
var ( ASCII = NewGraphicSet( "ASCII", &charmap.DEC_MSC_ASCII_CharSet, DSCSAscii, ) Supplemental = NewGraphicSet( "DEC Supplemental", &charmap.DEC_MSC_Supplemental_CharSet, DSCSSupplemental, ) SpecialGraphics = NewGraphicSet( "DEC Special Graphics", &charmap.DEC_SpecialGraphics_CharSet, DSCSSpecialGraphics, ) British = NewNRCGraphicSet( "British NRC", &charmap.DEC_NRC_British_CharSet, DSCSBritish, ) Dutch = NewNRCGraphicSet( "Dutch NRC", &charmap.DEC_NRC_Dutch_CharSet, DSCSDutch, ) Finnish = NewNRCGraphicSet( "Finnish NRC", &charmap.DEC_NRC_Finnish_CharSet, DSCSFinnish, ) French = NewNRCGraphicSet( "French NRC", &charmap.DEC_NRC_French_CharSet, DSCSFrench, ) FrenchCanadian = NewNRCGraphicSet( "French Canadian NRC", &charmap.DEC_NRC_FrenchCanadian_CharSet, DSCSFrenchCanadian, ) German = NewNRCGraphicSet( "German NRC", &charmap.DEC_NRC_German_CharSet, DSCSGerman, ) Italian = NewNRCGraphicSet( "Italian NRC", &charmap.DEC_NRC_Italian_CharSet, DSCSItalian, ) NorwegianDanish = NewNRCGraphicSet( "Norwegian/Danish NRC", &charmap.DEC_NRC_NorwegianDanish_CharSet, DSCSNorwegianDanish, ) Spanish = NewNRCGraphicSet( "Spanish NRC", &charmap.DEC_NRC_Spanish_CharSet, DSCSSpanish, ) Swedish = NewNRCGraphicSet( "Swedish NRC", &charmap.DEC_NRC_Swedish_CharSet, DSCSSwedish, ) Swiss = NewNRCGraphicSet( "Swiss NRC", &charmap.DEC_NRC_Swiss_CharSet, DSCSSwiss, ) )
Standard VT220 graphic sets. These are the character sets available in the VT220's graphics repertoire.
Functions ¶
This section is empty.
Types ¶
type GraphicSet ¶
type GraphicSet struct {
// CharSet is the character set for this graphic set.
CharSet *charmap.CharacterSet
// Name is a human-readable identifier for this character set.
Name string
// contains filtered or unexported fields
}
GraphicSet represents a character set that can be designated to a graphic register. It pairs a CharacterSet (for encoding/decoding) with the DSCS identifier bytes used in SCS escape sequences.
func NewGraphicSet ¶
func NewGraphicSet(name string, charSet *charmap.CharacterSet, dscs ...byte) *GraphicSet
NewGraphicSet creates a new GraphicSet with the given character set and DSCS bytes.
func NewNRCGraphicSet ¶
func NewNRCGraphicSet(name string, charSet *charmap.CharacterSet, dscs ...byte) *GraphicSet
NewNRCGraphicSet creates a new National Replacement Character GraphicSet. NRC sets are 7-bit character sets that require national mode (DECNRCM set).
func (*GraphicSet) DSCS ¶
func (g *GraphicSet) DSCS() []byte
DSCS returns the Designate Character Set Sequence identifier bytes. These are appended to the SCS prefix (ESC (, ESC ), etc.) to form the complete designation sequence.
func (*GraphicSet) IsNRC ¶
func (g *GraphicSet) IsNRC() bool
IsNRC returns true if this is a National Replacement Character set. NRC sets require 7-bit national mode and cannot be used in multinational mode.
type Repertoire ¶
type Repertoire struct {
// contains filtered or unexported fields
}
Repertoire holds a collection of available graphic sets. It provides lookup by name and iteration over available sets.
func VT220Repertoire ¶
func VT220Repertoire() *Repertoire
VT220Repertoire returns a repertoire pre-populated with the standard VT220 character sets.
func (*Repertoire) Add ¶
func (r *Repertoire) Add(set *GraphicSet)
Add adds a graphic set to the repertoire.
func (*Repertoire) All ¶
func (r *Repertoire) All() []*GraphicSet
All returns all graphic sets in the repertoire.
func (*Repertoire) AllNames ¶
func (r *Repertoire) AllNames() []string
AllNames returns all graphic set names in the repertoire.
func (*Repertoire) Get ¶
func (r *Repertoire) Get(name string) *GraphicSet
Get returns the graphic set with the given name, or nil if not found.