ufo

package
v0.0.0-...-f68edd7 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2026 License: Artistic-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FWritePlist

func FWritePlist(w io.Writer, cs map[string]string)

func MarshalValue

func MarshalValue(e *xml.Encoder, v interface{}) error

Specifically for the _value_ part of a [key value] in a <dict>; or the elements of an <array>.

func WriteContentsPlist

func WriteContentsPlist(path string, filemap map[string]string) error

Types

type Array

type Array struct {
	V []RawPlistValue `xml:",any"`
}

func (Array) MarshalXML

func (a Array) MarshalXML(e *xml.Encoder, start xml.StartElement) error

type Component

type Component struct {
	Base       string  `xml:"base,attr"`
	XScale     float64 `xml:"xScale,attr"`
	XyScale    float64 `xml:"xyScale,attr",omitempty`
	YxScale    float64 `xml:"yxScale,attr",omitempty`
	YScale     float64 `xml:"yScale,attr"`
	XOffset    float64 `xml:"xOffset,attr"`
	YOffset    float64 `xml:"yOffset,attr"`
	Identifier string  `xml:"identifier,attr,omitempty"`
}

func NewComponentAt

func NewComponentAt(base string, x, y float64) Component

type Contour

type Contour struct {
	Identifier string  `xml:"identifier,omitempty"`
	Point      []Point `xml:"point,omitempty"`
}

type Dict

type Dict struct {
	Item []DictItem
}

func (*Dict) MarshalXML

func (t *Dict) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (*Dict) UnmarshalXML

func (t *Dict) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type DictItem

type DictItem struct {
	Key   string
	Value interface{}
}

type Glyph

type Glyph struct {
	XMLName struct{} `xml:"glyph"`
	Name    string   `xml:"name,attr"`
	Format  string   `xml:"format,attr"`
	Advance struct {
		Width  *float64 `xml:"width,attr"`
		Height *float64 `xml:"height,attr"`
	} `xml:"advance"`
	Unicode []Unicode `xml:"unicode,omitempty"`
	Outline Outline   `xml:"outline"`
}

https://unifiedfontobject.org/versions/ufo3/glyphs/glif/

func NewGlyph

func NewGlyph(name string) Glyph

func (*Glyph) Filepath

func (u *Glyph) Filepath() string

type Outline

type Outline struct {
	Component []Component `xml:"component,omitempty"`
	Contour   []Contour   `xml:"contour,omitempty"`
}

type Plist

type Plist struct {
	XMLName struct{} `xml:"plist"`
	Version string   `xml:"version,attr"`
	Dict    Dict     `xml:"dict"`
}

func ReadPlist

func ReadPlist(path string) (*Plist, error)

func (*Plist) Get

func (pl *Plist) Get(key string) interface{}

Return the value associated with key (if there are multiple, the first one is returned). Returns nil if key is not found.

func (*Plist) String

func (pl *Plist) String() string

type Point

type Point struct {
	X          float64 `xml:"x,attr"`
	Y          float64 `xml:"y,attr"`
	Type       string  `xml:"type,attr,omitempty"`
	Smooth     string  `xml:"smooth,attr,omitempty"`
	Name       string  `xml:"name,attr,omitempty"`
	Identifier string  `xml:"identifier,attr,omitempty"`
}

type RawDict

type RawDict struct {
	Key   []string        `xml:"key"`
	Value []RawPlistValue `xml:",any"`
}

type RawPlistValue

type RawPlistValue struct {
	// contains filtered or unexported fields
}

func (*RawPlistValue) UnmarshalXML

func (v *RawPlistValue) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type Unicode

type Unicode struct {
	Hex string `xml:"hex,attr"`
}

Jump to

Keyboard shortcuts

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