paragraph

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// HorizontalAlignmentStart 左对齐
	HorizontalAlignmentStart = HorizontalAlignmentType("start")

	// HorizontalAlignmentEnd 右对齐
	HorizontalAlignmentEnd = HorizontalAlignmentType("end")

	// HorizontalAlignmentCenter 居中对齐
	HorizontalAlignmentCenter = HorizontalAlignmentType("center")

	// HorizontalAlignmentBoth 左右对齐,不改变字符间距
	HorizontalAlignmentBoth = HorizontalAlignmentType("both")

	// HorizontalAlignmentDistribute 左右对齐,改变字符间距
	HorizontalAlignmentDistribute = HorizontalAlignmentType("distribute")
)
View Source
const (
	BorderStyleNil                    = BorderStyle("nil")
	BorderStyleNone                   = BorderStyle("none")
	BorderStyleSingle                 = BorderStyle("single")
	BorderStyleDashDotStroked         = BorderStyle("dashDotStroked")
	BorderStyleDashed                 = BorderStyle("dashed")
	BorderStyleDashSmallGap           = BorderStyle("dashSmallGap")
	BorderStyleDotDash                = BorderStyle("dotDash")
	BorderStyleDotDotDash             = BorderStyle("dotDotDash")
	BorderStyleDotted                 = BorderStyle("dotted")
	BorderStyleDouble                 = BorderStyle("double")
	BorderStyleDoubleWave             = BorderStyle("doubleWave")
	BorderStyleInset                  = BorderStyle("inset")
	BorderStyleOutset                 = BorderStyle("outset")
	BorderStyleThick                  = BorderStyle("thick")
	BorderStyleThickThinLargeGap      = BorderStyle("thickThinLargeGap")
	BorderStyleThickThinMediumGap     = BorderStyle("thickThinMediumGap")
	BorderStyleThickThinSmallGap      = BorderStyle("thickThinSmallGap")
	BorderStyleThinThickLargeGap      = BorderStyle("thinThickLargeGap")
	BorderStyleThinThickMediumGap     = BorderStyle("thinThickMediumGap")
	BorderStyleThinThickSmallGap      = BorderStyle("thinThickSmallGap")
	BorderStyleThinThickThinLargeGap  = BorderStyle("thinThickThinLargeGap")
	BorderStyleThinThickThinMediumGap = BorderStyle("thinThickThinMediumGap")
	BorderStyleThinThickThinSmallGap  = BorderStyle("thinThickThinSmallGap")
	BorderStyleThreeDEmboss           = BorderStyle("threeDEmboss")
	BorderStyleThreeDEngrave          = BorderStyle("threeDEngrave")
	BorderStyleTriple                 = BorderStyle("triple")
	BorderStyleWave                   = BorderStyle("wave")
)
View Source
const (
	LineRuleTypeAtLeast = LineRuleType("atLeast")
	LineRuleTypeExactly = LineRuleType("exactly")
	LineRuleTypeAuto    = LineRuleType("auto")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Background

type Background struct {
	// contains filtered or unexported fields
}

Background 背景配置结构

func (*Background) GetBackgroundColor

func (b *Background) GetBackgroundColor() string

GetBackgroundColor 获取背景色

func (*Background) GetColor

func (b *Background) GetColor() string

GetColor 获取前景色

func (*Background) GetXmlBytes

func (b *Background) GetXmlBytes() ([]byte, error)

func (*Background) SetBackgroundColor

func (b *Background) SetBackgroundColor(color string) *Background

SetBackgroundColor 设置背景色,不包含#号

func (*Background) SetColor

func (b *Background) SetColor(color string) *Background

SetColor 设置前景色,不包含#号

func (*Background) SetMask

func (b *Background) SetMask(val string) *Background

SetMask 设置背景模式

type Border

type Border struct {
	// Color 颜色值,以十六进制字符串设置,不包含#号,例如FF0000
	Color string

	// Shadow 是否显示阴影
	Shadow bool

	// Space 间距偏移量,以磅(1/72英寸)为单位
	Space uint

	// Size 边框宽度
	// 最小值是2,最大值是96
	Size uint8

	// Style 边框样式
	// 段落边框只能是线条边框
	Style BorderStyle
}

Border 边框结构定义

type BorderManager

type BorderManager struct {
	// contains filtered or unexported fields
}

BorderManager 边框管理器

func (*BorderManager) GetXmlBytes

func (b *BorderManager) GetXmlBytes() ([]byte, error)

func (*BorderManager) SetBetween

func (b *BorderManager) SetBetween(style BorderStyle, color string, size uint8, space uint, shadow bool) *BorderManager

SetBetween 设置重合边框

func (*BorderManager) SetBorder

func (b *BorderManager) SetBorder(style BorderStyle, color string, size uint8, space uint, shadow bool) *BorderManager

SetBorder 统一设置边框样式

func (*BorderManager) SetBottom

func (b *BorderManager) SetBottom(style BorderStyle, color string, size uint8, space uint, shadow bool) *BorderManager

SetBottom 设置底部边框

func (*BorderManager) SetLeft

func (b *BorderManager) SetLeft(style BorderStyle, color string, size uint8, space uint, shadow bool) *BorderManager

SetLeft 设置左侧边框

func (*BorderManager) SetRight

func (b *BorderManager) SetRight(style BorderStyle, color string, size uint8, space uint, shadow bool) *BorderManager

SetRight 设置右侧边框

func (*BorderManager) SetTop

func (b *BorderManager) SetTop(style BorderStyle, color string, size uint8, space uint, shadow bool) *BorderManager

SetTop 设置顶部边框

type BorderStyle

type BorderStyle string

type HorizontalAlignmentType

type HorizontalAlignmentType string

type Identity

type Identity struct {
	// contains filtered or unexported fields
}

func (*Identity) GetXmlBytes

func (i *Identity) GetXmlBytes() ([]byte, error)

func (*Identity) SetFirstLine

func (i *Identity) SetFirstLine(firstLine int) *Identity

SetFirstLine 设置首行缩进

func (*Identity) SetHanging

func (i *Identity) SetHanging(hanging int) *Identity

SetHanging

func (*Identity) SetLeft

func (i *Identity) SetLeft(left int) *Identity

SetLeft 设置左侧缩进

func (*Identity) SetRight

func (i *Identity) SetRight(right int) *Identity

SetRight 设置右侧缩进

type LineRuleType

type LineRuleType string

type PPr

type PPr struct {
	// contains filtered or unexported fields
}

PPr 段落的样式属性定义

func (*PPr) GetBackground

func (p *PPr) GetBackground() *Background

GetBackground 获取背景配置结构指针

func (*PPr) GetBorder

func (p *PPr) GetBorder() *BorderManager

GetBorder 获取边框管理器

func (*PPr) GetDefaultXmlBytes

func (p *PPr) GetDefaultXmlBytes() ([]byte, error)

func (*PPr) GetExtraXmlBytes

func (p *PPr) GetExtraXmlBytes() ([]byte, error)

GetExtraXmlBytes 获取外部样式

func (*PPr) GetId

func (p *PPr) GetId() string

GetId 获取ID

func (*PPr) GetIdentity

func (p *PPr) GetIdentity() *Identity

GetIdentity 获取缩进配置结构指针

func (*PPr) GetInnerXmlBytes

func (p *PPr) GetInnerXmlBytes() ([]byte, error)

GetInnerXmlBytes 获取内联样式

func (*PPr) GetSection

func (p *PPr) GetSection() *section.Section

GetSection 获取节属性配置

func (*PPr) GetSpacing

func (p *PPr) GetSpacing() *Spacing

GetSpacing 获取段落间距配置结构指针

func (*PPr) SetHorizontalAlignment

func (p *PPr) SetHorizontalAlignment(alignment HorizontalAlignmentType) *PPr

SetHorizontalAlignment 设置水平对齐方式

func (*PPr) SetKeepLines

func (p *PPr) SetKeepLines(keepLines bool) *PPr

SetKeepLines

func (*PPr) SetKeepNext

func (p *PPr) SetKeepNext(keepNext bool) *PPr

SetKeepNext

type Paragraph

type Paragraph struct {
	// contains filtered or unexported fields
}

Paragraph 段落结构 每个段落都包含自己的样式属性定义以及任意个 Run 结构

func (*Paragraph) AddBreakLine

func (p *Paragraph) AddBreakLine(breakLineType run.BreakLineType, breakLineClearType run.BreakLineClearType)

AddBreakLine 添加换行符

func (*Paragraph) AddRun

func (p *Paragraph) AddRun() *run.Run

AddRun 新增一个内容结构

func (*Paragraph) GetProperties

func (p *Paragraph) GetProperties() *PPr

func (*Paragraph) GetRunProperties

func (p *Paragraph) GetRunProperties() *run.RPr

func (*Paragraph) GetRuns

func (p *Paragraph) GetRuns() []*run.Run

func (*Paragraph) GetXmlBytes

func (p *Paragraph) GetXmlBytes() ([]byte, error)

type Spacing

type Spacing struct {
	// contains filtered or unexported fields
}

Spacing 段落间距配置

func (*Spacing) GetXmlBytes

func (s *Spacing) GetXmlBytes() ([]byte, error)

func (*Spacing) SetAfter

func (s *Spacing) SetAfter(after int) *Spacing

SetAfter 设置段落后间距

func (*Spacing) SetAfterAutoSpacing

func (s *Spacing) SetAfterAutoSpacing(auto bool) *Spacing

SetAfterAutoSpacing 设置段落后间距自动

func (*Spacing) SetBefore

func (s *Spacing) SetBefore(before int) *Spacing

SetBefore 设置段落前间距

func (*Spacing) SetBeforeAutoSpacing

func (s *Spacing) SetBeforeAutoSpacing(auto bool) *Spacing

SetBeforeAutoSpacing 设置段落前间距自动

func (*Spacing) SetLine

func (s *Spacing) SetLine(line int) *Spacing

SetLine 设置段落内行间距

func (*Spacing) SetLineRule

func (s *Spacing) SetLineRule(rule LineRuleType) *Spacing

SetLineRule 设置段落内行间距规则

func (*Spacing) SetSpace

func (s *Spacing) SetSpace(space int) *Spacing

SetSpace 同时设置 before 与 after

Jump to

Keyboard shortcuts

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