Documentation
¶
Index ¶
- func BakedQuad(cdata []BakedChar, pw, ph, char_index int, xpos, ypos *float64, q *AlignedQuad, ...)
- func FreeFontInfo(p *FontInfo)
- func FreePackContext(p *PackContext)
- func FreePackRanges(p []PackRange)
- func FreePackedChars(p []PackedChar)
- func FreeRects(p []Rect)
- func GetFontOffsetForIndex(data []byte, index int) int
- func GetNumberOfFonts(data []byte) int
- func GetPackedQuad(p []PackedChar, pw, ph, char_index int, xpos, ypos *float64, q *AlignedQuad, ...)
- type AlignedQuad
- type BakedChar
- type Bitmap
- type FontInfo
- func (f *FontInfo) BoundingBox() image.Rectangle
- func (f *FontInfo) CodepointBox(codepoint rune) image.Rectangle
- func (f *FontInfo) CodepointHMetrics(codepoint rune) (advanceWidth, leftSideBearing int)
- func (f *FontInfo) CodepointKernAdvance(ch1, ch2 rune) int
- func (f *FontInfo) FontVMetrics() (ascent, descent, lineGap int)
- func (f *FontInfo) GlyphHMetrics(glyphIndex int) (advanceWidth, leftSideBearing int)
- func (f *FontInfo) GlyphKernAdvance(glyph1, glyph2 rune) int
- func (f *FontInfo) Init(data []byte, offset int) error
- func (f *FontInfo) ScaleForMappingEmToPixels(pixels float64) float64
- func (f *FontInfo) ScaleForPixelHeight(height float64) float64
- type PackContext
- func (p *PackContext) Begin(pixels []byte, width, height, stride_in_bytes, padding int) error
- func (p *PackContext) End()
- func (p *PackContext) FontRangesGatherRects(info *FontInfo, ranges []PackRange, rects []Rect) int
- func (p *PackContext) FontRangesPackRects(rects []Rect)
- func (p *PackContext) FontRangesRenderIntoRects(info *FontInfo, ranges []PackRange, rects []Rect)
- func (p *PackContext) Pixels() []byte
- func (p *PackContext) SetHeight(height int)
- func (p *PackContext) SetOversampling(h_oversample, v_oversample uint)
- func (p *PackContext) SetPixels(pixels []byte)
- func (p *PackContext) StrideInBytes() int
- type PackRange
- func (p *PackRange) CharDataForRange() []PackedChar
- func (p *PackRange) FirstUnicodeCodepointInRange() int
- func (p *PackRange) FirstUnicodepointInRange() int
- func (p *PackRange) FontSize() float64
- func (p *PackRange) NumChars() int
- func (p *PackRange) SetChardataForRange(chardata_for_range []PackedChar)
- func (p *PackRange) SetFirstUnicodeCodepointInRange(range_ int)
- func (p *PackRange) SetFontSize(font_size float64)
- func (p *PackRange) SetNumChars(num_chars int)
- type PackedChar
- type Rect
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 GetFontOffsetForIndex ¶
func GetNumberOfFonts ¶
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 (*Bitmap) StringSize ¶
type FontInfo ¶
type FontInfo C.stbtt_fontinfo
func NewFontInfo ¶
func NewFontInfo() *FontInfo
func (*FontInfo) BoundingBox ¶
func (*FontInfo) CodepointHMetrics ¶
func (*FontInfo) CodepointKernAdvance ¶
func (*FontInfo) FontVMetrics ¶
func (*FontInfo) GlyphHMetrics ¶
func (*FontInfo) GlyphKernAdvance ¶
func (*FontInfo) ScaleForMappingEmToPixels ¶
func (*FontInfo) ScaleForPixelHeight ¶
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 (*PackRange) CharDataForRange ¶
func (p *PackRange) CharDataForRange() []PackedChar
func (*PackRange) FirstUnicodeCodepointInRange ¶
func (*PackRange) FirstUnicodepointInRange ¶
func (*PackRange) SetChardataForRange ¶
func (p *PackRange) SetChardataForRange(chardata_for_range []PackedChar)
func (*PackRange) SetFirstUnicodeCodepointInRange ¶
func (*PackRange) SetFontSize ¶
func (*PackRange) SetNumChars ¶
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
Click to show internal directories.
Click to hide internal directories.