Documentation ¶
Index ¶
- func IsUnsupported(err error) bool
- type InvalidFontError
- type NotSupportedError
- type Parser
- func (p *Parser) Discard(n int) error
- func (p *Parser) Pos() int64
- func (p *Parser) Read(buf []byte) (int, error)
- func (p *Parser) ReadBytes(n int) ([]byte, error)
- func (p *Parser) ReadInt16() (int16, error)
- func (p *Parser) ReadUint16() (uint16, error)
- func (p *Parser) ReadUint16Slice() ([]uint16, error)
- func (p *Parser) ReadUint32() (uint32, error)
- func (p *Parser) ReadUint8() (uint8, error)
- func (p *Parser) SeekPos(filePos int64) error
- func (p *Parser) Size() int64
- type ReadSeekSizer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsUnsupported ¶
IsUnsupported returns true if the error is a NotSupportedError.
Types ¶
type InvalidFontError ¶
InvalidFontError indicates a problem with font data.
func (*InvalidFontError) Error ¶
func (err *InvalidFontError) Error() string
type NotSupportedError ¶
NotSupportedError indicates that a font file seems valid but uses a CFF feature which is not supported by this library.
func (*NotSupportedError) Error ¶
func (err *NotSupportedError) Error() string
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
Parser allows to read data from an sfnt file.
func (*Parser) Read ¶
Read reads len(buf) bytes of data into buf. It returns the number of bytes read and an error, if any. The error is non-nil if and only if less than len(buf) bytes were read.
func (*Parser) ReadBytes ¶
ReadBytes reads n bytes from the file, starting at the current position. The returned slice points into the internal buffer, slice contents must not be modified by the caller and are only valid until the next call to one of the parser methods.
The read size n must be <= 1024.
func (*Parser) ReadUint16 ¶
ReadUint16 reads a single uint16 value from the current position.
func (*Parser) ReadUint16Slice ¶
ReadUint16Slice reads a length followed by a sequence of uint16 values.
func (*Parser) ReadUint32 ¶
ReadUint32 reads a single uint32 value from the current position.
type ReadSeekSizer ¶
type ReadSeekSizer interface { io.ReadSeeker Size() int64 }
ReadSeekSizer describes the requirements for a reader that can be used as the input to a Parser.