Documentation ¶
Index ¶
- Constants
- func CalcSDF(img image.Image, radius float64, cutoff float64) []uint8
- func DrawGlyph(glyph *Glyph, smoothstep bool) image.Image
- func SavePNG(path string, img image.Image)
- type Fontstack
- func (*Fontstack) Descriptor() ([]byte, []int)
- func (m *Fontstack) GetGlyphs() []*Glyph
- func (m *Fontstack) GetName() string
- func (m *Fontstack) GetRange() string
- func (*Fontstack) ProtoMessage()
- func (m *Fontstack) Reset()
- func (m *Fontstack) String() string
- func (m *Fontstack) XXX_DiscardUnknown()
- func (m *Fontstack) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Fontstack) XXX_Merge(src proto.Message)
- func (m *Fontstack) XXX_Size() int
- func (m *Fontstack) XXX_Unmarshal(b []byte) error
- type Glyph
- func (*Glyph) Descriptor() ([]byte, []int)
- func (m *Glyph) GetAdvance() uint32
- func (m *Glyph) GetBitmap() []byte
- func (m *Glyph) GetHeight() uint32
- func (m *Glyph) GetId() uint32
- func (m *Glyph) GetLeft() int32
- func (m *Glyph) GetTop() int32
- func (m *Glyph) GetWidth() uint32
- func (*Glyph) ProtoMessage()
- func (m *Glyph) Reset()
- func (m *Glyph) String() string
- func (m *Glyph) XXX_DiscardUnknown()
- func (m *Glyph) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Glyph) XXX_Merge(src proto.Message)
- func (m *Glyph) XXX_Size() int
- func (m *Glyph) XXX_Unmarshal(b []byte) error
- type Glyphs
- func (*Glyphs) Descriptor() ([]byte, []int)
- func (*Glyphs) ExtensionRangeArray() []proto.ExtensionRange
- func (m *Glyphs) GetStacks() []*Fontstack
- func (*Glyphs) ProtoMessage()
- func (m *Glyphs) Reset()
- func (m *Glyphs) String() string
- func (m *Glyphs) XXX_DiscardUnknown()
- func (m *Glyphs) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Glyphs) XXX_Merge(src proto.Message)
- func (m *Glyphs) XXX_Size() int
- func (m *Glyphs) XXX_Unmarshal(b []byte) error
- type SDFBuilder
- type SDFBuilderOpt
Constants ¶
View Source
const INF = 1e20
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Fontstack ¶
type Fontstack struct { Name *string `protobuf:"bytes,1,req,name=name" json:"name,omitempty"` Range *string `protobuf:"bytes,2,req,name=range" json:"range,omitempty"` Glyphs []*Glyph `protobuf:"bytes,3,rep,name=glyphs" json:"glyphs,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
Stores fontstack information and a list of faces.
func (*Fontstack) Descriptor ¶
func (*Fontstack) ProtoMessage ¶
func (*Fontstack) ProtoMessage()
func (*Fontstack) XXX_DiscardUnknown ¶
func (m *Fontstack) XXX_DiscardUnknown()
func (*Fontstack) XXX_Marshal ¶
func (*Fontstack) XXX_Unmarshal ¶
type Glyph ¶
type Glyph struct { Id *uint32 `protobuf:"varint,1,req,name=id" json:"id,omitempty"` // A signed distance field of the glyph with a border of 3 pixels. Bitmap []byte `protobuf:"bytes,2,opt,name=bitmap" json:"bitmap,omitempty"` // Glyph metrics. Width *uint32 `protobuf:"varint,3,req,name=width" json:"width,omitempty"` Height *uint32 `protobuf:"varint,4,req,name=height" json:"height,omitempty"` Left *int32 `protobuf:"zigzag32,5,req,name=left" json:"left,omitempty"` Top *int32 `protobuf:"zigzag32,6,req,name=top" json:"top,omitempty"` Advance *uint32 `protobuf:"varint,7,req,name=advance" json:"advance,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
Stores a glyph with metrics and optional SDF bitmap information.
func (*Glyph) Descriptor ¶
func (*Glyph) GetAdvance ¶
func (*Glyph) ProtoMessage ¶
func (*Glyph) ProtoMessage()
func (*Glyph) XXX_DiscardUnknown ¶
func (m *Glyph) XXX_DiscardUnknown()
func (*Glyph) XXX_Marshal ¶
func (*Glyph) XXX_Unmarshal ¶
type Glyphs ¶
type Glyphs struct { Stacks []*Fontstack `protobuf:"bytes,1,rep,name=stacks" json:"stacks,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` proto.XXX_InternalExtensions `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Glyphs) Descriptor ¶
func (*Glyphs) ExtensionRangeArray ¶
func (*Glyphs) ExtensionRangeArray() []proto.ExtensionRange
func (*Glyphs) ProtoMessage ¶
func (*Glyphs) ProtoMessage()
func (*Glyphs) XXX_DiscardUnknown ¶
func (m *Glyphs) XXX_DiscardUnknown()
func (*Glyphs) XXX_Marshal ¶
func (*Glyphs) XXX_Unmarshal ¶
type SDFBuilder ¶
type SDFBuilder struct { Font *truetype.Font Face font.Face SDFBuilderOpt // contains filtered or unexported fields }
func NewSDFBuilder ¶
func NewSDFBuilder(font *truetype.Font, opts ...SDFBuilderOpt) *SDFBuilder
func (*SDFBuilder) Glyph ¶
func (b *SDFBuilder) Glyph(x rune) *Glyph
func (*SDFBuilder) Init ¶
func (b *SDFBuilder) Init()
type SDFBuilderOpt ¶
Click to show internal directories.
Click to hide internal directories.