fontbridge

package
v0.0.40 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyToChartStyle

func ApplyToChartStyle(style *chart.Style, fontType string)

ApplyToChartStyle aplica la configuración de fontbridge a los estilos de chart

func GetDrawingColor

func GetDrawingColor(r, g, b uint8) drawing.Color

GetDrawingColor convierte RGBColor de docpdf a drawing.Color para chart

func InitFromDocConfig

func InitFromDocConfig(fontPath string, fontFile string, titleSize, normalSize, footnoteSize float64,
	titleColor, normalColor, footnoteColor drawing.Color, lineSpacing float64) error

InitFromDocConfig actualiza la configuración compartida desde docpdf.FontConfig

func LoadFont

func LoadFont(fontPath string, fontFile string) (*truetype.Font, error)

LoadFont carga una fuente desde el sistema de archivos

Types

type FontConfig

type FontConfig struct {
	// Font es la fuente cargada desde TrueType
	Font *truetype.Font

	// Tamaños de fuente para diferentes elementos
	TitleSize      float64 // Para títulos de gráficos (Header1)
	AxisLabelSize  float64 // Para etiquetas de ejes (Normal)
	ValueLabelSize float64 // Para etiquetas de valores (Normal)
	LegendSize     float64 // Para leyendas (Normal o Footnote)

	// Colores
	TitleColor      drawing.Color
	AxisLabelColor  drawing.Color
	ValueLabelColor drawing.Color
	LegendColor     drawing.Color

	// Espaciado
	LineSpacing float64
}

FontConfig contiene la configuración de fuente compartida entre docpdf y chart

var SharedFontConfig *FontConfig

Instancia global de configuración

Jump to

Keyboard shortcuts

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