Documentation
¶
Index ¶
- type AdjustRightInd
- type Bold
- type BoldCs
- type Color
- type CustomStyle
- type Fonts
- type Format
- type Highlight
- type Ind
- type Italic
- type ItalicCs
- type Justification
- type Kern
- type Kinsoku
- type Name
- type OverflowPunct
- type ParagraphProperties
- func (p *ParagraphProperties) Align(align string) *ParagraphProperties
- func (p *ParagraphProperties) IndCustom(ind Ind) *ParagraphProperties
- func (p *ParagraphProperties) IndFirst() *ParagraphProperties
- func (p *ParagraphProperties) LineSpce(before, after int) *ParagraphProperties
- func (p *ParagraphProperties) XSpce(x float64) *ParagraphProperties
- type RGB
- type RunProperties
- type RunStyle
- type Shade
- type Size
- type SizeCs
- type SnapToGrid
- type Spacing
- type Style
- type TextAlignment
- type Underline
- type VertAlign
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdjustRightInd ¶
type AdjustRightInd struct {
XMLName xml.Name `xml:"w:adjustRightInd,omitempty"`
Val int `xml:"w:val,attr"`
}
AdjustRightInd ...
type CustomStyle ¶
type CustomStyle struct {
XMLName xml.Name `xml:"w:style"`
Type string `xml:"w:type,attr"`
Id int64 `xml:"w:styleId,attr"`
Flg string `xml:"w:customStyle,attr"`
StyleName *Name
Format *Format
PPR *ParagraphProperties
RPR *RunProperties
}
func (*CustomStyle) CreatePPR ¶
func (c *CustomStyle) CreatePPR() *ParagraphProperties
func (*CustomStyle) CreateRPR ¶
func (c *CustomStyle) CreateRPR() *RunProperties
type Fonts ¶
type Fonts struct {
XMLName xml.Name `xml:"w:rFonts,omitempty"`
ASCII string `xml:"w:ascii,attr,omitempty"`
EastAsia string `xml:"w:eastAsia,attr,omitempty"`
HAnsi string `xml:"w:hAnsi,attr,omitempty"`
Cs string `xml:"w:cs,attr,omitempty"`
Hint string `xml:"w:hint,attr,omitempty"`
}
Fonts 字体类型
type Highlight ¶
type Highlight struct {
XMLName xml.Name `xml:"w:highlight,omitempty"`
Val string `xml:"w:val,attr,omitempty"`
}
Highlight 高亮
type Ind ¶
type Ind struct {
XMLName xml.Name `xml:"w:ind,omitempty"`
LeftChars int `xml:"w:leftChars,attr,omitempty"`
Left int `xml:"w:left,attr,omitempty"`
FirstLineChars int `xml:"w:firstLineChars,attr,omitempty"`
FirstLine int `xml:"w:firstLine,attr,omitempty"`
HangingChars int `xml:"w:hangingChars,attr,omitempty"`
Hanging int `xml:"w:hanging,attr,omitempty"`
}
Ind 缩进
type Justification ¶
Justification 对齐方式
w:jc 属性的取值可以是以下之一: start:左对齐。 center:居中对齐。 end:右对齐。 both:两端对齐。 distribute:分散对齐。
type OverflowPunct ¶
type OverflowPunct struct {
XMLName xml.Name `xml:"w:overflowPunct,omitempty"`
Val int `xml:"w:val,attr"`
}
OverflowPunct ...
type ParagraphProperties ¶
type ParagraphProperties struct {
XMLName xml.Name `xml:"w:pPr,omitempty"`
Spacing *Spacing
Ind *Ind
Justification *Justification
Shade *Shade
Kern *Kern
Style *Style
TextAlignment *TextAlignment
AdjustRightInd *AdjustRightInd
SnapToGrid *SnapToGrid
Kinsoku *Kinsoku
OverflowPunct *OverflowPunct
}
func (*ParagraphProperties) Align ¶
func (p *ParagraphProperties) Align(align string) *ParagraphProperties
Align 对齐方式 left:左对齐。center:居中对齐。 right:右对齐。both:两端对齐。distribute:分散对齐。
func (*ParagraphProperties) IndCustom ¶
func (p *ParagraphProperties) IndCustom(ind Ind) *ParagraphProperties
IndCustom 自定义缩进
func (*ParagraphProperties) IndFirst ¶
func (p *ParagraphProperties) IndFirst() *ParagraphProperties
IndFirst 首行缩进
func (*ParagraphProperties) LineSpce ¶
func (p *ParagraphProperties) LineSpce(before, after int) *ParagraphProperties
LineSpce 设置行间距
func (*ParagraphProperties) XSpce ¶
func (p *ParagraphProperties) XSpce(x float64) *ParagraphProperties
XSpce 设置x倍行距
type RunProperties ¶
type RunProperties struct {
XMLName xml.Name `xml:"w:rPr,omitempty"`
Fonts *Fonts
BCs *BoldCs
Bold *Bold
ICs *ItalicCs
Italic *Italic
Highlight *Highlight
Color *Color
Size *Size
SizeCs *SizeCs
Spacing *Spacing
RunStyle *RunStyle
Style *Style
Shade *Shade
Kern *Kern
Underline *Underline
VertAlign *VertAlign
}
func (*RunProperties) SetColor ¶
func (r *RunProperties) SetColor(color ...any) *RunProperties
SetColor allows to set run color
color: [3]uint8{0-255,0-255,0-255} , 000000-FFFFFF
func (*RunProperties) SetFont ¶
func (r *RunProperties) SetFont(font ...string) *RunProperties
SetFont sets the font of the run
font []string = []string{"楷体"} 或
[]string{ASCII,EastAsia,HAnsi,Cs,Hint}
func (*RunProperties) SetSize ¶
func (r *RunProperties) SetSize(size float64) *RunProperties
SetSize 字号
type Shade ¶
type Shade struct {
XMLName xml.Name `xml:"w:shd,omitempty"`
Val string `xml:"w:val,attr,omitempty"`
Color string `xml:"w:color,attr,omitempty"`
Fill string `xml:"w:fill,attr,omitempty"`
ThemeFill string `xml:"w:themeFill,attr,omitempty"`
ThemeFillTint string `xml:"w:themeFillTint,attr,omitempty"`
}
Shade 阴影
type SnapToGrid ¶
type SnapToGrid struct {
XMLName xml.Name `xml:"w:snapToGrid,omitempty"`
Val int `xml:"w:val,attr"`
}
SnapToGrid ...
type Spacing ¶
type Spacing struct {
XMLName xml.Name `xml:"w:spacing,omitempty"`
Val int `xml:"w:val,attr,omitempty"`
BeforeLines int `xml:"w:beforeLines,attr,omitempty"`
Before int `xml:"w:before,attr,omitempty"`
AfterLines int `xml:"w:afterLines,attr,omitempty"`
After int `xml:"w:after,attr,omitempty"`
Line int `xml:"w:line,attr,omitempty"`
LineRule string `xml:"w:lineRule,attr,omitempty"`
}
Spacing 行距
type TextAlignment ¶
type TextAlignment struct {
XMLName xml.Name `xml:"w:textAlignment,omitempty"`
Val string `xml:"w:val,attr"`
}
TextAlignment ...
Click to show internal directories.
Click to hide internal directories.