stbtt

package
v0.0.0-...-697b985 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2019 License: BSD-3-Clause, Zlib Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BakedQuad

func BakedQuad(cdata []BakedChar, pw, ph, char_index int, xpos, ypos *float64, q *AlignedQuad, opengl_fillrule int)

func FreeFontInfo

func FreeFontInfo(p *FontInfo)

func FreePackContext

func FreePackContext(p *PackContext)

func FreePackRanges

func FreePackRanges(p []PackRange)

func FreePackedChars

func FreePackedChars(p []PackedChar)

func FreeRects

func FreeRects(p []Rect)

func GetFontOffsetForIndex

func GetFontOffsetForIndex(data []byte, index int) int

func GetNumberOfFonts

func GetNumberOfFonts(data []byte) int

func GetPackedQuad

func GetPackedQuad(p []PackedChar, pw, ph, char_index int, xpos, ypos *float64, q *AlignedQuad, align_to_integer int)

Types

type AlignedQuad

type AlignedQuad C.stbtt_aligned_quad

func (*AlignedQuad) S0

func (q *AlignedQuad) S0() float64

func (*AlignedQuad) S1

func (q *AlignedQuad) S1() float64

func (*AlignedQuad) T0

func (q *AlignedQuad) T0() float64

func (*AlignedQuad) T1

func (q *AlignedQuad) T1() float64

func (*AlignedQuad) X0

func (q *AlignedQuad) X0() float64

func (*AlignedQuad) X1

func (q *AlignedQuad) X1() float64

func (*AlignedQuad) Y0

func (q *AlignedQuad) Y0() float64

func (*AlignedQuad) Y1

func (q *AlignedQuad) Y1() float64

type BakedChar

type BakedChar C.stbtt_bakedchar

type Bitmap

type Bitmap struct {
	*image.RGBA
	*FontInfo
	Chardata    []BakedChar
	Firstchar   rune
	PixelHeight float64
	FG, BG      color.RGBA
}

func BakeFontBitmap

func BakeFontBitmap(data []byte, offset int, pixel_height float64, pw, ph int, first_char rune, num_chars int) (bmp *Bitmap, numfits int, err error)

func (*Bitmap) Print

func (b *Bitmap) Print(m *image.RGBA, x, y int, args ...interface{})

func (*Bitmap) Printf

func (b *Bitmap) Printf(m *image.RGBA, x, y int, format string, args ...interface{})

func (*Bitmap) StringSize

func (b *Bitmap) StringSize(text string) (width, height float64)

type FontInfo

type FontInfo C.stbtt_fontinfo

func NewFontInfo

func NewFontInfo() *FontInfo

func (*FontInfo) BoundingBox

func (f *FontInfo) BoundingBox() image.Rectangle

func (*FontInfo) CodepointBox

func (f *FontInfo) CodepointBox(codepoint rune) image.Rectangle

func (*FontInfo) CodepointHMetrics

func (f *FontInfo) CodepointHMetrics(codepoint rune) (advanceWidth, leftSideBearing int)

func (*FontInfo) CodepointKernAdvance

func (f *FontInfo) CodepointKernAdvance(ch1, ch2 rune) int

func (*FontInfo) FontVMetrics

func (f *FontInfo) FontVMetrics() (ascent, descent, lineGap int)

func (*FontInfo) GlyphHMetrics

func (f *FontInfo) GlyphHMetrics(glyphIndex int) (advanceWidth, leftSideBearing int)

func (*FontInfo) GlyphKernAdvance

func (f *FontInfo) GlyphKernAdvance(glyph1, glyph2 rune) int

func (*FontInfo) Init

func (f *FontInfo) Init(data []byte, offset int) error

func (*FontInfo) ScaleForMappingEmToPixels

func (f *FontInfo) ScaleForMappingEmToPixels(pixels float64) float64

func (*FontInfo) ScaleForPixelHeight

func (f *FontInfo) ScaleForPixelHeight(height float64) float64

type PackContext

type PackContext C.stbtt_pack_context

func NewPackContext

func NewPackContext() *PackContext

func (*PackContext) Begin

func (p *PackContext) Begin(pixels []byte, width, height, stride_in_bytes, padding int) error

func (*PackContext) End

func (p *PackContext) End()

func (*PackContext) FontRangesGatherRects

func (p *PackContext) FontRangesGatherRects(info *FontInfo, ranges []PackRange, rects []Rect) int

func (*PackContext) FontRangesPackRects

func (p *PackContext) FontRangesPackRects(rects []Rect)

func (*PackContext) FontRangesRenderIntoRects

func (p *PackContext) FontRangesRenderIntoRects(info *FontInfo, ranges []PackRange, rects []Rect)

func (*PackContext) Pixels

func (p *PackContext) Pixels() []byte

func (*PackContext) SetHeight

func (p *PackContext) SetHeight(height int)

func (*PackContext) SetOversampling

func (p *PackContext) SetOversampling(h_oversample, v_oversample uint)

func (*PackContext) SetPixels

func (p *PackContext) SetPixels(pixels []byte)

func (*PackContext) StrideInBytes

func (p *PackContext) StrideInBytes() int

type PackRange

type PackRange C.stbtt_pack_range

func MakePackRanges

func MakePackRanges(n int) []PackRange

func (*PackRange) CharDataForRange

func (p *PackRange) CharDataForRange() []PackedChar

func (*PackRange) FirstUnicodeCodepointInRange

func (p *PackRange) FirstUnicodeCodepointInRange() int

func (*PackRange) FirstUnicodepointInRange

func (p *PackRange) FirstUnicodepointInRange() int

func (*PackRange) FontSize

func (p *PackRange) FontSize() float64

func (*PackRange) NumChars

func (p *PackRange) NumChars() int

func (*PackRange) SetChardataForRange

func (p *PackRange) SetChardataForRange(chardata_for_range []PackedChar)

func (*PackRange) SetFirstUnicodeCodepointInRange

func (p *PackRange) SetFirstUnicodeCodepointInRange(range_ int)

func (*PackRange) SetFontSize

func (p *PackRange) SetFontSize(font_size float64)

func (*PackRange) SetNumChars

func (p *PackRange) SetNumChars(num_chars int)

type PackedChar

type PackedChar C.stbtt_packedchar

func MakePackedChars

func MakePackedChars(n int) []PackedChar

func (*PackedChar) X0

func (p *PackedChar) X0() int

func (*PackedChar) X1

func (p *PackedChar) X1() int

func (*PackedChar) XAdvance

func (p *PackedChar) XAdvance() float64

func (*PackedChar) Y0

func (p *PackedChar) Y0() int

func (*PackedChar) Y1

func (p *PackedChar) Y1() int

type Rect

type Rect C.stbrp_rect

func MakeRects

func MakeRects(n int) []Rect

func (*Rect) H

func (r *Rect) H() int

func (*Rect) ID

func (r *Rect) ID() int

func (*Rect) SetH

func (r *Rect) SetH(h int)

func (*Rect) SetW

func (r *Rect) SetW(w int)

func (*Rect) SetX

func (r *Rect) SetX(x int)

func (*Rect) SetY

func (r *Rect) SetY(y int)

func (*Rect) W

func (r *Rect) W() int

func (*Rect) WasPacked

func (r *Rect) WasPacked() int

func (*Rect) X

func (r *Rect) X() int

func (*Rect) Y

func (r *Rect) Y() int

Jump to

Keyboard shortcuts

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