Documentation
¶
Index ¶
- Constants
- func CloseLibrary() error
- func GetGlyphScript(ch rune) (uint32, error)
- func GetVersion() sdl.Version
- func Init() error
- func LoadLibrary(path string) error
- func Path() string
- func Quit()
- func StringToTag(str string) uint32
- func TagToString(tag uint32, size uintptr) string
- func WasInit() int32
- type CopyOperation
- type Direction
- type DrawCommand
- type DrawOperation
- type FillOperation
- type Font
- func (font *Font) AddFallback(fallback *Font) error
- func (font *Font) Ascent() int32
- func (font *Font) ClearFallbacks()
- func (font *Font) Close()
- func (font *Font) Copy() (*Font, error)
- func (font *Font) DPI() (int32, int32, error)
- func (font *Font) Descent() int32
- func (font *Font) Direction() Direction
- func (font *Font) FamilyName() string
- func (font *Font) Generation() uint32
- func (font *Font) GlyphImage(ch uint32) (*sdl.Surface, ImageType, error)
- func (font *Font) GlyphImageForIndex(glyphIndex uint32) (*sdl.Surface, ImageType, error)
- func (font *Font) GlyphKerning(previousCh, ch rune) (int32, error)
- func (font *Font) GlyphMetrics(ch uint32) (*GlyphMetrics, error)
- func (font *Font) HasGlyph(ch uint32) bool
- func (font *Font) Height() int32
- func (font *Font) Hinting() HintingFlags
- func (font *Font) IsFixedWidth() bool
- func (font *Font) IsScalable() bool
- func (font *Font) Kerning() bool
- func (font *Font) LineSkip() int32
- func (font *Font) MeasureString(text string, maxWidth int32) (int32, uintptr, error)
- func (font *Font) NumFaces() int32
- func (font *Font) Outline() int32
- func (font *Font) Properties() sdl.PropertiesID
- func (font *Font) RemoveFallback(fallback *Font)
- func (font *Font) RenderGlyphBlended(glyph rune, fg sdl.Color) (*sdl.Surface, error)
- func (font *Font) RenderGlyphLCD(glyph rune, fg, bg sdl.Color) (*sdl.Surface, error)
- func (font *Font) RenderGlyphShaded(glyph rune, fg, bg sdl.Color) (*sdl.Surface, error)
- func (font *Font) RenderGlyphSolid(glyph rune, fg sdl.Color) (*sdl.Surface, error)
- func (font *Font) RenderTextBlended(text string, fg sdl.Color) (*sdl.Surface, error)
- func (font *Font) RenderTextBlendedWrapped(text string, fg sdl.Color, wrapWidth int32) (*sdl.Surface, error)
- func (font *Font) RenderTextLCD(text string, fg, bg sdl.Color) (*sdl.Surface, error)
- func (font *Font) RenderTextLCDWrapped(text string, fg, bg sdl.Color, wrapWidth int32) (*sdl.Surface, error)
- func (font *Font) RenderTextShaded(text string, fg, bg sdl.Color) (*sdl.Surface, error)
- func (font *Font) RenderTextShadedWrapped(text string, fg, bg sdl.Color, wrapWidth int32) (*sdl.Surface, error)
- func (font *Font) RenderTextSolid(text string, fg sdl.Color) (*sdl.Surface, error)
- func (font *Font) RenderTextSolidWrapped(text string, fg sdl.Color, wrapLength int32) (*sdl.Surface, error)
- func (font *Font) SDF() bool
- func (font *Font) Script() uint32
- func (font *Font) SetDirection(direction Direction) error
- func (font *Font) SetHinting(hinting HintingFlags)
- func (font *Font) SetKerning(enabled bool)
- func (font *Font) SetLanguage(languageBCP47 string) error
- func (font *Font) SetLineSkip(lineskip int32)
- func (font *Font) SetOutline(outline int32) error
- func (font *Font) SetSDF(enabled bool) error
- func (font *Font) SetScript(script uint32) error
- func (font *Font) SetSize(ptsize float32) error
- func (font *Font) SetSizeDPI(ptsize float32, hdpi, vdpi int32) error
- func (font *Font) SetStyle(style FontStyleFlags)
- func (font *Font) SetWrapAlignment(align HorizontalAlignment)
- func (font *Font) Size() (float32, error)
- func (font *Font) StringSize(text string) (int32, int32, error)
- func (font *Font) StringSizeWrapped(text string, wrapWidth int32) (int32, int32, error)
- func (font *Font) Style() FontStyleFlags
- func (font *Font) StyleName() string
- func (font *Font) WrapAlignment() HorizontalAlignment
- type FontStyleFlags
- type GPUAtlasDrawSequence
- type GPUTextEngineWinding
- type GlyphMetrics
- type HintingFlags
- type HorizontalAlignment
- type ImageType
- type LibraryVersion
- type Pointer
- type SubString
- type SubStringFlags
- type Text
- func (text *Text) AppendString(str string) error
- func (text *Text) Color() (sdl.Color, error)
- func (text *Text) ColorFloat() (sdl.FColor, error)
- func (text *Text) DeleteString(offset int32, length int32) error
- func (text *Text) Destroy()
- func (text *Text) Direction() Direction
- func (text *Text) DrawRenderer(x, y float32) error
- func (text *Text) DrawSurface(x, y int32, surface *sdl.Surface) error
- func (text *Text) Engine() (*TextEngine, error)
- func (text *Text) Font() (*Font, error)
- func (text *Text) GPUDrawData() (*GPUAtlasDrawSequence, error)
- func (text *Text) InsertString(offset int32, str string) error
- func (text *Text) NextSubString(substring *SubString) (*SubString, error)
- func (text *Text) Position() (int32, int32)
- func (text *Text) PreviousSubString(substring *SubString) (*SubString, error)
- func (text *Text) Properties() sdl.PropertiesID
- func (text *Text) Script() uint32
- func (text *Text) SetColor(r, g, b, a uint8) error
- func (text *Text) SetColorFloat(r, g, b, a float32) error
- func (text *Text) SetDirection(direction Direction) error
- func (text *Text) SetEngine(engine *TextEngine) error
- func (text *Text) SetFont(font *Font) error
- func (text *Text) SetPosition(x, y int32)
- func (text *Text) SetScript(script uint32) error
- func (text *Text) SetString(str string) error
- func (text *Text) SetWrapWhitespaceVisible(visible bool) error
- func (text *Text) SetWrapWidth(wrapWidth int32) error
- func (text *Text) Size() (int32, int32, error)
- func (text *Text) SubString(offset int32) (*SubString, error)
- func (text *Text) SubStringForLine(line int32) (*SubString, error)
- func (text *Text) SubStringForPoint(x, y int32) (*SubString, error)
- func (text *Text) SubStringsForRange(offset int32, length int32) ([]*SubString, error)
- func (text *Text) Update() error
- func (text *Text) WrapWhitespaceVisible() bool
- func (text *Text) WrapWidth() (int32, error)
- type TextData
- type TextEngine
- func CreateGPUTextEngine(device *sdl.GPUDevice) (*TextEngine, error)
- func CreateGPUTextEngineWithProperties(props sdl.PropertiesID) (*TextEngine, error)
- func CreateRendererTextEngine(renderer *sdl.Renderer) (*TextEngine, error)
- func CreateRendererTextEngineWithProperties(props sdl.PropertiesID) (*TextEngine, error)
- func CreateSurfaceTextEngine() (*TextEngine, error)
- func (engine *TextEngine) CreateText(font *Font, text string) (*Text, error)
- func (engine *TextEngine) DestroyGPU()
- func (engine *TextEngine) DestroyRenderer()
- func (engine *TextEngine) DestroySurface()
- func (engine *TextEngine) GPUWinding() GPUTextEngineWinding
- func (engine *TextEngine) SetGPUWinding(winding GPUTextEngineWinding)
- type TextLayout
Constants ¶
const ( PROP_FONT_CREATE_FILENAME_STRING = "SDL_ttf.font.create.filename" PROP_FONT_CREATE_IOSTREAM_POINTER = "SDL_ttf.font.create.iostream" PROP_FONT_CREATE_IOSTREAM_OFFSET_NUMBER = "SDL_ttf.font.create.iostream.offset" PROP_FONT_CREATE_IOSTREAM_AUTOCLOSE_BOOLEAN = "SDL_ttf.font.create.iostream.autoclose" PROP_FONT_CREATE_SIZE_FLOAT = "SDL_ttf.font.create.size" PROP_FONT_CREATE_FACE_NUMBER = "SDL_ttf.font.create.face" PROP_FONT_CREATE_HORIZONTAL_DPI_NUMBER = "SDL_ttf.font.create.hdpi" PROP_FONT_CREATE_VERTICAL_DPI_NUMBER = "SDL_ttf.font.create.vdpi" PROP_FONT_CREATE_EXISTING_FONT = "SDL_ttf.font.create.existing_font" )
const ( PROP_RENDERER_TEXT_ENGINE_RENDERER = "SDL_ttf.renderer_text_engine.create.renderer" PROP_RENDERER_TEXT_ENGINE_ATLAS_TEXTURE_SIZE = "SDL_ttf.renderer_text_engine.create.atlas_texture_size" )
Variables ¶
This section is empty.
Functions ¶
func CloseLibrary ¶
func CloseLibrary() error
CloseLibrary releases resources associated with the library.
func GetGlyphScript ¶
TTF_GetGlyphScript - Get the script used by a 32-bit codepoint. (https://wiki.libsdl.org/SDL3_ttf/TTF_GetGlyphScript)
func GetVersion ¶
TTF_Version - This function gets the version of the dynamically linked SDL_ttf library. (https://wiki.libsdl.org/SDL3_ttf/TTF_Version)
func Init ¶
func Init() error
TTF_Init - Initialize SDL_ttf. (https://wiki.libsdl.org/SDL3_ttf/TTF_Init)
func LoadLibrary ¶
LoadLibrary loads SDL_ttf library and initializes all functions.
func Path ¶
func Path() string
Path returns the library installation path based on the operating system
func Quit ¶
func Quit()
TTF_Quit - Deinitialize SDL_ttf. (https://wiki.libsdl.org/SDL3_ttf/TTF_Quit)
func StringToTag ¶
TTF_StringToTag - Convert from a 4 character string to a 32-bit tag. (https://wiki.libsdl.org/SDL3_ttf/TTF_StringToTag)
func TagToString ¶
TTF_TagToString - Convert from a 32-bit tag to a 4 character string. (https://wiki.libsdl.org/SDL3_ttf/TTF_TagToString)
func WasInit ¶
func WasInit() int32
TTF_WasInit - Check if SDL_ttf is initialized. (https://wiki.libsdl.org/SDL3_ttf/TTF_WasInit)
Types ¶
type CopyOperation ¶
type Direction ¶
type Direction uint32
TTF_Direction - Direction flags (https://wiki.libsdl.org/SDL3_ttf/TTF_Direction)
type DrawCommand ¶
type DrawCommand uint32
const ( DRAW_COMMAND_NOOP DrawCommand = 0 DRAW_COMMAND_FILL DrawCommand = 1 DRAW_COMMAND_COPY DrawCommand = 2 )
type DrawOperation ¶
type DrawOperation struct {
Cmd DrawCommand
// contains filtered or unexported fields
}
union type
func (*DrawOperation) CopyOperation ¶
func (d *DrawOperation) CopyOperation() *CopyOperation
func (*DrawOperation) FillOperation ¶
func (d *DrawOperation) FillOperation() *FillOperation
type FillOperation ¶
type FillOperation struct {
Cmd DrawCommand
Rect sdl.Rect
}
type Font ¶
type Font struct{}
TTF_Font - The internal structure containing font information. (https://wiki.libsdl.org/SDL3_ttf/TTF_Font)
func OpenFont ¶
TTF_OpenFont - Create a font from a file, using a specified point size. (https://wiki.libsdl.org/SDL3_ttf/TTF_OpenFont)
func OpenFontIO ¶
TTF_OpenFontIO - Create a font from an SDL_IOStream, using a specified point size. (https://wiki.libsdl.org/SDL3_ttf/TTF_OpenFontIO)
func OpenFontWithProperties ¶
func OpenFontWithProperties(props sdl.PropertiesID) (*Font, error)
TTF_OpenFontWithProperties - Create a font with the specified properties. (https://wiki.libsdl.org/SDL3_ttf/TTF_OpenFontWithProperties)
func (*Font) AddFallback ¶
TTF_AddFallbackFont - Add a fallback font. (https://wiki.libsdl.org/SDL3_ttf/TTF_AddFallbackFont)
func (*Font) Ascent ¶
TTF_GetFontAscent - Query the offset from the baseline to the top of a font. (https://wiki.libsdl.org/SDL3_ttf/TTF_GetFontAscent)
func (*Font) ClearFallbacks ¶
func (font *Font) ClearFallbacks()
TTF_ClearFallbackFonts - Remove all fallback fonts. (https://wiki.libsdl.org/SDL3_ttf/TTF_ClearFallbackFonts)
func (*Font) Close ¶
func (font *Font) Close()
TTF_CloseFont - Dispose of a previously-created font. (https://wiki.libsdl.org/SDL3_ttf/TTF_CloseFont)
func (*Font) Copy ¶
TTF_CopyFont - Create a copy of an existing font. (https://wiki.libsdl.org/SDL3_ttf/TTF_CopyFont)
func (*Font) DPI ¶
TTF_GetFontDPI - Get font target resolutions, in dots per inch. (https://wiki.libsdl.org/SDL3_ttf/TTF_GetFontDPI)
func (*Font) Descent ¶
TTF_GetFontDescent - Query the offset from the baseline to the bottom of a font. (https://wiki.libsdl.org/SDL3_ttf/TTF_GetFontDescent)
func (*Font) Direction ¶
TTF_GetFontDirection - Get the direction to be used for text shaping by a font. (https://wiki.libsdl.org/SDL3_ttf/TTF_GetFontDirection)
func (*Font) FamilyName ¶
TTF_GetFontFamilyName - Query a font's family name. (https://wiki.libsdl.org/SDL3_ttf/TTF_GetFontFamilyName)
func (*Font) Generation ¶
TTF_GetFontGeneration - Get the font generation. (https://wiki.libsdl.org/SDL3_ttf/TTF_GetFontGeneration)
func (*Font) GlyphImage ¶
TTF_GetGlyphImage - Get the pixel image for a UNICODE codepoint. (https://wiki.libsdl.org/SDL3_ttf/TTF_GetGlyphImage)
func (*Font) GlyphImageForIndex ¶
TTF_GetGlyphImageForIndex - Get the pixel image for a character index. (https://wiki.libsdl.org/SDL3_ttf/TTF_GetGlyphImageForIndex)
func (*Font) GlyphKerning ¶
TTF_GetGlyphKerning - Query the kerning size between the glyphs of two UNICODE codepoints. (https://wiki.libsdl.org/SDL3_ttf/TTF_GetGlyphKerning)
func (*Font) GlyphMetrics ¶
func (font *Font) GlyphMetrics(ch uint32) (*GlyphMetrics, error)
TTF_GetGlyphMetrics - Query the metrics (dimensions) of a font's glyph for a UNICODE codepoint. (https://wiki.libsdl.org/SDL3_ttf/TTF_GetGlyphMetrics)
func (*Font) HasGlyph ¶
TTF_FontHasGlyph - Check whether a glyph is provided by the font for a UNICODE codepoint. (https://wiki.libsdl.org/SDL3_ttf/TTF_FontHasGlyph)
func (*Font) Height ¶
TTF_GetFontHeight - Query the total height of a font. (https://wiki.libsdl.org/SDL3_ttf/TTF_GetFontHeight)
func (*Font) Hinting ¶
func (font *Font) Hinting() HintingFlags
TTF_GetFontHinting - Query a font's current FreeType hinter setting. (https://wiki.libsdl.org/SDL3_ttf/TTF_GetFontHinting)
func (*Font) IsFixedWidth ¶
TTF_FontIsFixedWidth - Query whether a font is fixed-width. (https://wiki.libsdl.org/SDL3_ttf/TTF_FontIsFixedWidth)
func (*Font) IsScalable ¶
TTF_FontIsScalable - Query whether a font is scalable or not. (https://wiki.libsdl.org/SDL3_ttf/TTF_FontIsScalable)
func (*Font) Kerning ¶
TTF_GetFontKerning - Query whether or not kerning is enabled for a font. (https://wiki.libsdl.org/SDL3_ttf/TTF_GetFontKerning)
func (*Font) LineSkip ¶
TTF_GetFontLineSkip - Query the spacing between lines of text for a font. (https://wiki.libsdl.org/SDL3_ttf/TTF_GetFontLineSkip)
func (*Font) MeasureString ¶
TTF_MeasureString - Calculate how much of a UTF-8 string will fit in a given width. Returns the measured_width, measured_length (https://wiki.libsdl.org/SDL3_ttf/TTF_MeasureString)
func (*Font) NumFaces ¶
TTF_GetNumFontFaces - Query the number of faces of a font. (https://wiki.libsdl.org/SDL3_ttf/TTF_GetNumFontFaces)
func (*Font) Outline ¶
TTF_GetFontOutline - Query a font's current outline. (https://wiki.libsdl.org/SDL3_ttf/TTF_GetFontOutline)
func (*Font) Properties ¶
func (font *Font) Properties() sdl.PropertiesID
TTF_GetFontProperties - Get the properties associated with a font. (https://wiki.libsdl.org/SDL3_ttf/TTF_GetFontProperties)
func (*Font) RemoveFallback ¶
TTF_RemoveFallbackFont - Remove a fallback font. (https://wiki.libsdl.org/SDL3_ttf/TTF_RemoveFallbackFont)
func (*Font) RenderGlyphBlended ¶
TTF_RenderGlyph_Blended - Render a single UNICODE codepoint at high quality to a new ARGB surface. (https://wiki.libsdl.org/SDL3_ttf/TTF_RenderGlyph_Blended)
func (*Font) RenderGlyphLCD ¶
TTF_RenderGlyph_LCD - Render a single UNICODE codepoint at LCD subpixel quality to a new ARGB surface. (https://wiki.libsdl.org/SDL3_ttf/TTF_RenderGlyph_LCD)
func (*Font) RenderGlyphShaded ¶
TTF_RenderGlyph_Shaded - Render a single UNICODE codepoint at high quality to a new 8-bit surface. (https://wiki.libsdl.org/SDL3_ttf/TTF_RenderGlyph_Shaded)
func (*Font) RenderGlyphSolid ¶
TTF_RenderGlyph_Solid - Render a single 32-bit glyph at fast quality to a new 8-bit surface. (https://wiki.libsdl.org/SDL3_ttf/TTF_RenderGlyph_Solid)
func (*Font) RenderTextBlended ¶
TTF_RenderText_Blended - Render UTF-8 text at high quality to a new ARGB surface. (https://wiki.libsdl.org/SDL3_ttf/TTF_RenderText_Blended)
func (*Font) RenderTextBlendedWrapped ¶
func (font *Font) RenderTextBlendedWrapped(text string, fg sdl.Color, wrapWidth int32) (*sdl.Surface, error)
TTF_RenderText_Blended_Wrapped - Render word-wrapped UTF-8 text at high quality to a new ARGB surface. (https://wiki.libsdl.org/SDL3_ttf/TTF_RenderText_Blended_Wrapped)
func (*Font) RenderTextLCD ¶
TTF_RenderText_LCD - Render UTF-8 text at LCD subpixel quality to a new ARGB surface. (https://wiki.libsdl.org/SDL3_ttf/TTF_RenderText_LCD)
func (*Font) RenderTextLCDWrapped ¶
func (font *Font) RenderTextLCDWrapped(text string, fg, bg sdl.Color, wrapWidth int32) (*sdl.Surface, error)
TTF_RenderText_LCD_Wrapped - Render word-wrapped UTF-8 text at LCD subpixel quality to a new ARGB surface. (https://wiki.libsdl.org/SDL3_ttf/TTF_RenderText_LCD_Wrapped)
func (*Font) RenderTextShaded ¶
TTF_RenderText_Shaded - Render UTF-8 text at high quality to a new 8-bit surface. (https://wiki.libsdl.org/SDL3_ttf/TTF_RenderText_Shaded)
func (*Font) RenderTextShadedWrapped ¶
func (font *Font) RenderTextShadedWrapped(text string, fg, bg sdl.Color, wrapWidth int32) (*sdl.Surface, error)
TTF_RenderText_Shaded_Wrapped - Render word-wrapped UTF-8 text at high quality to a new 8-bit surface. (https://wiki.libsdl.org/SDL3_ttf/TTF_RenderText_Shaded_Wrapped)
func (*Font) RenderTextSolid ¶
TTF_RenderText_Solid - Render UTF-8 text at fast quality to a new 8-bit surface. (https://wiki.libsdl.org/SDL3_ttf/TTF_RenderText_Solid)
func (*Font) RenderTextSolidWrapped ¶
func (font *Font) RenderTextSolidWrapped(text string, fg sdl.Color, wrapLength int32) (*sdl.Surface, error)
TTF_RenderText_Solid_Wrapped - Render word-wrapped UTF-8 text at fast quality to a new 8-bit surface. (https://wiki.libsdl.org/SDL3_ttf/TTF_RenderText_Solid_Wrapped)
func (*Font) SDF ¶
TTF_GetFontSDF - Query whether Signed Distance Field rendering is enabled for a font. (https://wiki.libsdl.org/SDL3_ttf/TTF_GetFontSDF)
func (*Font) Script ¶
TTF_GetFontScript - Get the script used for text shaping a font. (https://wiki.libsdl.org/SDL3_ttf/TTF_GetFontScript)
func (*Font) SetDirection ¶
TTF_SetFontDirection - Set the direction to be used for text shaping by a font. (https://wiki.libsdl.org/SDL3_ttf/TTF_SetFontDirection)
func (*Font) SetHinting ¶
func (font *Font) SetHinting(hinting HintingFlags)
TTF_SetFontHinting - Set a font's current hinter setting. (https://wiki.libsdl.org/SDL3_ttf/TTF_SetFontHinting)
func (*Font) SetKerning ¶
TTF_SetFontKerning - Set if kerning is enabled for a font. (https://wiki.libsdl.org/SDL3_ttf/TTF_SetFontKerning)
func (*Font) SetLanguage ¶
TTF_SetFontLanguage - Set language to be used for text shaping by a font. (https://wiki.libsdl.org/SDL3_ttf/TTF_SetFontLanguage)
func (*Font) SetLineSkip ¶
TTF_SetFontLineSkip - Set the spacing between lines of text for a font. (https://wiki.libsdl.org/SDL3_ttf/TTF_SetFontLineSkip)
func (*Font) SetOutline ¶
TTF_SetFontOutline - Set a font's current outline. (https://wiki.libsdl.org/SDL3_ttf/TTF_SetFontOutline)
func (*Font) SetSDF ¶
TTF_SetFontSDF - Enable Signed Distance Field rendering for a font. (https://wiki.libsdl.org/SDL3_ttf/TTF_SetFontSDF)
func (*Font) SetScript ¶
TTF_SetFontScript - Set the script to be used for text shaping by a font. (https://wiki.libsdl.org/SDL3_ttf/TTF_SetFontScript)
func (*Font) SetSize ¶
TTF_SetFontSize - Set a font's size dynamically. (https://wiki.libsdl.org/SDL3_ttf/TTF_SetFontSize)
func (*Font) SetSizeDPI ¶
TTF_SetFontSizeDPI - Set font size dynamically with target resolutions, in dots per inch. (https://wiki.libsdl.org/SDL3_ttf/TTF_SetFontSizeDPI)
func (*Font) SetStyle ¶
func (font *Font) SetStyle(style FontStyleFlags)
TTF_SetFontStyle - Set a font's current style. (https://wiki.libsdl.org/SDL3_ttf/TTF_SetFontStyle)
func (*Font) SetWrapAlignment ¶
func (font *Font) SetWrapAlignment(align HorizontalAlignment)
TTF_SetFontWrapAlignment - Set a font's current wrap alignment option. (https://wiki.libsdl.org/SDL3_ttf/TTF_SetFontWrapAlignment)
func (*Font) Size ¶
TTF_GetFontSize - Get the size of a font. (https://wiki.libsdl.org/SDL3_ttf/TTF_GetFontSize)
func (*Font) StringSize ¶
TTF_GetStringSize - Calculate the dimensions of a rendered string of UTF-8 text. (https://wiki.libsdl.org/SDL3_ttf/TTF_GetStringSize)
func (*Font) StringSizeWrapped ¶
TTF_GetStringSizeWrapped - Calculate the dimensions of a rendered string of UTF-8 text. (https://wiki.libsdl.org/SDL3_ttf/TTF_GetStringSizeWrapped)
func (*Font) Style ¶
func (font *Font) Style() FontStyleFlags
TTF_GetFontStyle - Query a font's current style. (https://wiki.libsdl.org/SDL3_ttf/TTF_GetFontStyle)
func (*Font) StyleName ¶
TTF_GetFontStyleName - Query a font's style name. (https://wiki.libsdl.org/SDL3_ttf/TTF_GetFontStyleName)
func (*Font) WrapAlignment ¶
func (font *Font) WrapAlignment() HorizontalAlignment
TTF_GetFontWrapAlignment - Query a font's current wrap alignment option. (https://wiki.libsdl.org/SDL3_ttf/TTF_GetFontWrapAlignment)
type FontStyleFlags ¶
type FontStyleFlags uint32
TTF_FontStyleFlags - Font style flags for [TTF_Font](TTF_Font) (https://wiki.libsdl.org/SDL3_ttf/TTF_FontStyleFlags)
type GPUAtlasDrawSequence ¶
type GPUAtlasDrawSequence struct {
AtlasTexture *sdl.GPUTexture // Texture atlas that stores the glyphs
Xy *sdl.FPoint // An array of vertex positions
Uv *sdl.FPoint // An array of normalized texture coordinates for each vertex
NumVertices int32 // Number of vertices
Indices *int32 // An array of indices into the 'vertices' arrays
NumIndices int32 // Number of indices
ImageType ImageType // The image type of this draw sequence
Next *GPUAtlasDrawSequence // The next sequence (will be NULL in case of the last sequence)
}
TTF_GPUAtlasDrawSequence - Draw sequence returned by [TTF_GetGPUTextDrawData](TTF_GetGPUTextDrawData) (https://wiki.libsdl.org/SDL3_ttf/TTF_GPUAtlasDrawSequence)
type GPUTextEngineWinding ¶
type GPUTextEngineWinding uint32
TTF_GPUTextEngineWinding - The winding order of the vertices returned by [TTF_GetGPUTextDrawData](TTF_GetGPUTextDrawData) (https://wiki.libsdl.org/SDL3_ttf/TTF_GPUTextEngineWinding)
const ( GPU_TEXTENGINE_WINDING_INVALID GPUTextEngineWinding = 4294967295 GPU_TEXTENGINE_WINDING_CLOCKWISE GPUTextEngineWinding = 0 GPU_TEXTENGINE_WINDING_COUNTER_CLOCKWISE GPUTextEngineWinding = 1 )
type GlyphMetrics ¶
type HintingFlags ¶
type HintingFlags uint32
TTF_HintingFlags - Hinting flags for TTF (TrueType Fonts) (https://wiki.libsdl.org/SDL3_ttf/TTF_HintingFlags)
const ( HINTING_INVALID HintingFlags = 4294967295 HINTING_NORMAL HintingFlags = 0 // Normal hinting applies standard grid-fitting. HINTING_LIGHT HintingFlags = 1 // Light hinting applies subtle adjustments to improve rendering. HINTING_MONO HintingFlags = 2 // Monochrome hinting adjusts the font for better rendering at lower resolutions. HINTING_NONE HintingFlags = 3 // No hinting, the font is rendered without any grid-fitting. HINTING_LIGHT_SUBPIXEL HintingFlags = 4 // Light hinting with subpixel rendering for more precise font edges. )
type HorizontalAlignment ¶
type HorizontalAlignment uint32
TTF_HorizontalAlignment - The horizontal alignment used when rendering wrapped text. (https://wiki.libsdl.org/SDL3_ttf/TTF_HorizontalAlignment)
const ( HORIZONTAL_ALIGN_INVALID HorizontalAlignment = 4294967295 HORIZONTAL_ALIGN_LEFT HorizontalAlignment = 0 HORIZONTAL_ALIGN_CENTER HorizontalAlignment = 1 HORIZONTAL_ALIGN_RIGHT HorizontalAlignment = 2 )
type ImageType ¶
type ImageType uint32
TTF_ImageType - The type of data in a glyph image (https://wiki.libsdl.org/SDL3_ttf/TTF_ImageType)
type LibraryVersion ¶
func FreeTypeVersion ¶
func FreeTypeVersion() LibraryVersion
TTF_GetFreeTypeVersion - Query the version of the FreeType library in use. (https://wiki.libsdl.org/SDL3_ttf/TTF_GetFreeTypeVersion)
func HarfBuzzVersion ¶
func HarfBuzzVersion() LibraryVersion
TTF_GetHarfBuzzVersion - Query the version of the HarfBuzz library in use. (https://wiki.libsdl.org/SDL3_ttf/TTF_GetHarfBuzzVersion)
type SubString ¶
type SubString struct {
Flags SubStringFlags // The flags for this substring
Offset int32 // The byte offset from the beginning of the text
Length int32 // The byte length starting at the offset
LineIndex int32 // The index of the line that contains this substring
ClusterIndex int32 // The internal cluster index, used for quickly iterating
Rect sdl.Rect // The rectangle, relative to the top left of the text, containing the substring
}
TTF_SubString - The representation of a substring within text. (https://wiki.libsdl.org/SDL3_ttf/TTF_SubString)
type SubStringFlags ¶
type SubStringFlags uint32
TTF_SubStringFlags - Flags for [TTF_SubString](TTF_SubString) (https://wiki.libsdl.org/SDL3_ttf/TTF_SubStringFlags)
type Text ¶
type Text struct {
Text string // A copy of the UTF-8 string that this text object represents, useful for layout, debugging and retrieving substring text. This is updated when the text object is modified and will be freed automatically when the object is destroyed.
NumLines int32 // The number of lines in the text, 0 if it's empty
Refcount int32 // Application reference count, used when freeing surface
Internal *TextData // Private
}
TTF_Text - Text created with [TTF_CreateText](TTF_CreateText)() (https://wiki.libsdl.org/SDL3_ttf/TTF_Text)
func (*Text) AppendString ¶
TTF_AppendTextString - Append UTF-8 text to a text object. (https://wiki.libsdl.org/SDL3_ttf/TTF_AppendTextString)
func (*Text) Color ¶
TTF_GetTextColor - Get the color of a text object. (https://wiki.libsdl.org/SDL3_ttf/TTF_GetTextColor)
func (*Text) ColorFloat ¶
TTF_GetTextColorFloat - Get the color of a text object. (https://wiki.libsdl.org/SDL3_ttf/TTF_GetTextColorFloat)
func (*Text) DeleteString ¶
TTF_DeleteTextString - Delete UTF-8 text from a text object. (https://wiki.libsdl.org/SDL3_ttf/TTF_DeleteTextString)
func (*Text) Destroy ¶
func (text *Text) Destroy()
TTF_DestroyText - Destroy a text object created by a text engine. (https://wiki.libsdl.org/SDL3_ttf/TTF_DestroyText)
func (*Text) Direction ¶
TTF_GetTextDirection - Get the direction to be used for text shaping a text object. (https://wiki.libsdl.org/SDL3_ttf/TTF_GetTextDirection)
func (*Text) DrawRenderer ¶
TTF_DrawRendererText - Draw text to an SDL renderer. (https://wiki.libsdl.org/SDL3_ttf/TTF_DrawRendererText)
func (*Text) DrawSurface ¶
TTF_DrawSurfaceText - Draw text to an SDL surface. (https://wiki.libsdl.org/SDL3_ttf/TTF_DrawSurfaceText)
func (*Text) Engine ¶
func (text *Text) Engine() (*TextEngine, error)
TTF_GetTextEngine - Get the text engine used by a text object. (https://wiki.libsdl.org/SDL3_ttf/TTF_GetTextEngine)
func (*Text) Font ¶
TTF_GetTextFont - Get the font used by a text object. (https://wiki.libsdl.org/SDL3_ttf/TTF_GetTextFont)
func (*Text) GPUDrawData ¶
func (text *Text) GPUDrawData() (*GPUAtlasDrawSequence, error)
TTF_GetGPUTextDrawData - Get the geometry data needed for drawing the text. (https://wiki.libsdl.org/SDL3_ttf/TTF_GetGPUTextDrawData)
func (*Text) InsertString ¶
TTF_InsertTextString - Insert UTF-8 text into a text object. (https://wiki.libsdl.org/SDL3_ttf/TTF_InsertTextString)
func (*Text) NextSubString ¶
TTF_GetNextTextSubString - Get the previous substring in a text object (https://wiki.libsdl.org/SDL3_ttf/TTF_GetNextTextSubString)
func (*Text) Position ¶
TTF_GetTextPosition - Get the position of a text object. (https://wiki.libsdl.org/SDL3_ttf/TTF_GetTextPosition)
func (*Text) PreviousSubString ¶
TTF_GetPreviousTextSubString - Get the previous substring in a text object (https://wiki.libsdl.org/SDL3_ttf/TTF_GetPreviousTextSubString)
func (*Text) Properties ¶
func (text *Text) Properties() sdl.PropertiesID
TTF_GetTextProperties - Get the properties associated with a text object. (https://wiki.libsdl.org/SDL3_ttf/TTF_GetTextProperties)
func (*Text) Script ¶
TTF_GetTextScript - Get the script used for text shaping a text object. (https://wiki.libsdl.org/SDL3_ttf/TTF_GetTextScript)
func (*Text) SetColor ¶
TTF_SetTextColor - Set the color of a text object. (https://wiki.libsdl.org/SDL3_ttf/TTF_SetTextColor)
func (*Text) SetColorFloat ¶
TTF_SetTextColorFloat - Set the color of a text object. (https://wiki.libsdl.org/SDL3_ttf/TTF_SetTextColorFloat)
func (*Text) SetDirection ¶
TTF_SetTextDirection - Set the direction to be used for text shaping a text object. (https://wiki.libsdl.org/SDL3_ttf/TTF_SetTextDirection)
func (*Text) SetEngine ¶
func (text *Text) SetEngine(engine *TextEngine) error
TTF_SetTextEngine - Set the text engine used by a text object. (https://wiki.libsdl.org/SDL3_ttf/TTF_SetTextEngine)
func (*Text) SetFont ¶
TTF_SetTextFont - Set the font used by a text object. (https://wiki.libsdl.org/SDL3_ttf/TTF_SetTextFont)
func (*Text) SetPosition ¶
TTF_SetTextPosition - Set the position of a text object. (https://wiki.libsdl.org/SDL3_ttf/TTF_SetTextPosition)
func (*Text) SetScript ¶
TTF_SetTextScript - Set the script to be used for text shaping a text object. (https://wiki.libsdl.org/SDL3_ttf/TTF_SetTextScript)
func (*Text) SetString ¶
TTF_SetTextString - Set the UTF-8 text used by a text object. (https://wiki.libsdl.org/SDL3_ttf/TTF_SetTextString)
func (*Text) SetWrapWhitespaceVisible ¶
TTF_SetTextWrapWhitespaceVisible - Set whether whitespace should be visible when wrapping a text object. (https://wiki.libsdl.org/SDL3_ttf/TTF_SetTextWrapWhitespaceVisible)
func (*Text) SetWrapWidth ¶
TTF_SetTextWrapWidth - Set whether wrapping is enabled on a text object. (https://wiki.libsdl.org/SDL3_ttf/TTF_SetTextWrapWidth)
func (*Text) Size ¶
TTF_GetTextSize - Get the size of a text object. (https://wiki.libsdl.org/SDL3_ttf/TTF_GetTextSize)
func (*Text) SubString ¶
TTF_GetTextSubString - Get the substring of a text object that surrounds a text offset. (https://wiki.libsdl.org/SDL3_ttf/TTF_GetTextSubString)
func (*Text) SubStringForLine ¶
TTF_GetTextSubStringForLine - Get the substring of a text object that contains the given line. (https://wiki.libsdl.org/SDL3_ttf/TTF_GetTextSubStringForLine)
func (*Text) SubStringForPoint ¶
TTF_GetTextSubStringForPoint - Get the portion of a text string that is closest to a point. (https://wiki.libsdl.org/SDL3_ttf/TTF_GetTextSubStringForPoint)
func (*Text) SubStringsForRange ¶
TTF_GetTextSubStringsForRange - Get the substrings of a text object that contain a range of text. (https://wiki.libsdl.org/SDL3_ttf/TTF_GetTextSubStringsForRange)
func (*Text) Update ¶
TTF_UpdateText - Update the layout of a text object. (https://wiki.libsdl.org/SDL3_ttf/TTF_UpdateText)
func (*Text) WrapWhitespaceVisible ¶
TTF_TextWrapWhitespaceVisible - Return whether whitespace is shown when wrapping a text object. (https://wiki.libsdl.org/SDL3_ttf/TTF_TextWrapWhitespaceVisible)
type TextData ¶
type TextData struct {
Font *Font
Color sdl.FColor
NeedsLayoutUpdate bool
Layout *TextLayout
X int32
Y int32
W int32
H int32
NumOps int32
Ops *DrawOperation
NumClusters int32
Clusters *SubString
Props sdl.PropertiesID
NeedsEngineUpdate bool
Engine *TextEngine
EngineText Pointer
}
TTF_TextData - Internal data for [TTF_Text](TTF_Text) (https://wiki.libsdl.org/SDL3_ttf/TTF_TextData)
type TextEngine ¶
type TextEngine struct {
Version uint32
Userdata Pointer
CreateTextFunc Pointer
DestroyTextFunc Pointer
}
TTF_TextEngine - A text engine used to create text objects. (https://wiki.libsdl.org/SDL3_ttf/TTF_TextEngine)
func CreateGPUTextEngine ¶
func CreateGPUTextEngine(device *sdl.GPUDevice) (*TextEngine, error)
TTF_CreateGPUTextEngine - Create a text engine for drawing text with the SDL GPU API. (https://wiki.libsdl.org/SDL3_ttf/TTF_CreateGPUTextEngine)
func CreateGPUTextEngineWithProperties ¶
func CreateGPUTextEngineWithProperties(props sdl.PropertiesID) (*TextEngine, error)
TTF_CreateGPUTextEngineWithProperties - Create a text engine for drawing text with the SDL GPU API, with the specified properties. (https://wiki.libsdl.org/SDL3_ttf/TTF_CreateGPUTextEngineWithProperties)
func CreateRendererTextEngine ¶
func CreateRendererTextEngine(renderer *sdl.Renderer) (*TextEngine, error)
TTF_CreateRendererTextEngine - Create a text engine for drawing text on an SDL renderer. (https://wiki.libsdl.org/SDL3_ttf/TTF_CreateRendererTextEngine)
func CreateRendererTextEngineWithProperties ¶
func CreateRendererTextEngineWithProperties(props sdl.PropertiesID) (*TextEngine, error)
TTF_CreateRendererTextEngineWithProperties - Create a text engine for drawing text on an SDL renderer, with the specified properties. (https://wiki.libsdl.org/SDL3_ttf/TTF_CreateRendererTextEngineWithProperties)
func CreateSurfaceTextEngine ¶
func CreateSurfaceTextEngine() (*TextEngine, error)
TTF_CreateSurfaceTextEngine - Create a text engine for drawing text on SDL surfaces. (https://wiki.libsdl.org/SDL3_ttf/TTF_CreateSurfaceTextEngine)
func (*TextEngine) CreateText ¶
func (engine *TextEngine) CreateText(font *Font, text string) (*Text, error)
TTF_CreateText - Create a text object from UTF-8 text and a text engine. (https://wiki.libsdl.org/SDL3_ttf/TTF_CreateText)
func (*TextEngine) DestroyGPU ¶
func (engine *TextEngine) DestroyGPU()
TTF_DestroyGPUTextEngine - Destroy a text engine created for drawing text with the SDL GPU API. (https://wiki.libsdl.org/SDL3_ttf/TTF_DestroyGPUTextEngine)
func (*TextEngine) DestroyRenderer ¶
func (engine *TextEngine) DestroyRenderer()
TTF_DestroyRendererTextEngine - Destroy a text engine created for drawing text on an SDL renderer. (https://wiki.libsdl.org/SDL3_ttf/TTF_DestroyRendererTextEngine)
func (*TextEngine) DestroySurface ¶
func (engine *TextEngine) DestroySurface()
TTF_DestroySurfaceTextEngine - Destroy a text engine created for drawing text on SDL surfaces. (https://wiki.libsdl.org/SDL3_ttf/TTF_DestroySurfaceTextEngine)
func (*TextEngine) GPUWinding ¶
func (engine *TextEngine) GPUWinding() GPUTextEngineWinding
TTF_GetGPUTextEngineWinding - Get the winding order of the vertices returned by TTF_GetGPUTextDrawData for a particular GPU text engine (https://wiki.libsdl.org/SDL3_ttf/TTF_GetGPUTextEngineWinding)
func (*TextEngine) SetGPUWinding ¶
func (engine *TextEngine) SetGPUWinding(winding GPUTextEngineWinding)
TTF_SetGPUTextEngineWinding - Sets the winding order of the vertices returned by TTF_GetGPUTextDrawData for a particular GPU text engine. (https://wiki.libsdl.org/SDL3_ttf/TTF_SetGPUTextEngineWinding)
type TextLayout ¶
type TextLayout struct{}