Documentation
¶
Overview ¶
Package config contains configuration structures for docpdf.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Alignment ¶
type Alignment int
position representa una posición o alineación en el documento
const ( // Left representa alineación a la izquierda Left Alignment = 8 //001000 // Top representa alineación superior Top Alignment = 4 //000100 // Right representa alineación a la derecha Right Alignment = 2 //000010 // Bottom representa alineación inferior Bottom Alignment = 1 //000001 // Center representa alineación al centro Center Alignment = 16 //010000 // Middle representa alineación al medio Middle Alignment = 32 //100000 // Justify representa texto justificado Justify Alignment = 64 //1000000 // AllBorders representa todos los bordes AllBorders Alignment = 15 //001111 )
type FontFamily ¶
type FontFamily struct {
// Regular specifies the filename for the regular font style.
// It's recommended to name this file "regular.ttf".
Regular string
// Bold specifies the filename for the bold font style.
// It's recommended to name this file "bold.ttf".
Bold string
// Italic specifies the filename for the italic font style.
// It's recommended to name this file "italic.ttf".
Italic string
// Underline specifies the filename for the underline font style.
// It's recommended to name this file "underline.ttf".
Underline string
// Path specifies the base directory where the font files are located.
// Defaults to "fonts/".
Path string // Base path for fonts defaults to "fonts/"
}
FontFamily represents font files for different styles It contains the regular, bold, italic, and other styles.
type FontIntStyle ¶
type FontIntStyle int
FontIntStyle represents font styles as integer constants This was previously named FontStyle in docFont.go. eg: FontStyleBold = 2 (000010), FontStyleItalic = 1 (000001), etc.
const FontStyleBold FontIntStyle = 2 //000010
Bold - font style bold
const FontStyleItalic FontIntStyle = 1 //000001
Italic - font style italic
const FontStyleRegular FontIntStyle = 0 //000000
regular - font style regular
const FontStyleUnderline FontIntStyle = 3 //000011
Underline - font style underline
func GetFontStyleInIntFormat ¶
func GetFontStyleInIntFormat(fontStyle string) (style FontIntStyle)
GetFontStyleInIntFormat converts a string font style to its integer representation eg: "B" => FontStyleBold, "I" => FontStyleItalic, "U" => FontStyleUnderline defaults to FontStyleRegular if no valid style is found
type TextStyle ¶
type TextStyle struct {
Size float64
Color style.Color
LineSpacing float64
Alignment Alignment
SpaceBefore float64
SpaceAfter float64
}
TextStyle defines the style configuration for different text sections
type TextStyles ¶
type TextStyles struct {
FontFamily FontFamily
Normal TextStyle
Header1 TextStyle
Header2 TextStyle
Header3 TextStyle
Footnote TextStyle
PageHeader TextStyle
ChartLabel TextStyle // For chart bar labels/values
ChartAxisLabel TextStyle // For chart axis labels (X/Y axes)
}
TextStyles represents different font configurations for document sections. This was previously named FontConfig in docFont.go.
func DefaultTextStyles ¶
func DefaultTextStyles() TextStyles
DefaultTextStyles returns word-processor like defaults