Documentation ¶
Index ¶
- Constants
- func CommonGenerateAtomicCell(children *[]mardown) (pagebreak, over bool, err error)
- func Convert2JPEG(srcPath string, dstPath string) error
- func ConvertBMP2JPEG(srcPath, dstPath string) (err error)
- func ConvertPNG2JPEG(srcPath, dstPath string) (err error)
- func ConvertTIFF2JPEG(srcPath, dstPath string) (err error)
- func ConvertWEBP2JPEG(srcPath, dstPath string) (err error)
- func DrawFiveCycle(srcPath string)
- func DrawInnerFiveCycle(srcPath string)
- func DrawPNG(srcPath string)
- func DrawPlumCurve(srcPath string)
- func DrawRotationOutCircle(srcPath string)
- func DrawSunLine(srcPath string)
- func GetImageWidthAndHeight(picturePath string) (w, h int)
- type Div
- func (div *Div) Copy(content string) *Div
- func (div *Div) GenerateAtomicCell() error
- func (div *Div) GetHeight() (height float64)
- func (div *Div) GetWidth() (width float64)
- func (div *Div) HorizontalCentered() *Div
- func (div *Div) RightAlign() *Div
- func (div *Div) SetBackColor(color string) *Div
- func (div *Div) SetBorder(border core.Scope) *Div
- func (div *Div) SetContent(content string) *Div
- func (div *Div) SetFont(font core.Font) *Div
- func (div *Div) SetFontColor(color string) *Div
- func (div *Div) SetFontWithColor(font core.Font, color string) *Div
- func (div *Div) SetFrameType(frameType int) *Div
- func (div *Div) SetMarign(margin core.Scope) *Div
- type HLine
- type Image
- type MarkdownText
- type MdBlockQuote
- type MdHeader
- type MdImage
- type MdList
- type MdMutiText
- type MdParagraph
- type MdSpace
- type MdText
- type Span
- func (span *Span) Copy(content string) *Span
- func (span *Span) GenerateAtomicCell() error
- func (span *Span) GetHeight() (height float64)
- func (span *Span) GetWidth() (width float64)
- func (span *Span) HorizontalCentered() *Span
- func (span *Span) RightAlign() *Span
- func (span *Span) SetBorder(border core.Scope) *Span
- func (span *Span) SetContent(content string) *Span
- func (span *Span) SetFont(font core.Font) *Span
- func (span *Span) SetFontColor(color string) *Span
- func (span *Span) SetFontWithColor(font core.Font, color string) *Span
- func (span *Span) SetHeight(height float64) *Span
- func (span *Span) SetMarign(margin core.Scope) *Span
- func (span *Span) VerticalCentered() *Span
- type Table
- func (table *Table) GenerateAtomicCell() error
- func (table *Table) GetColWidth(row, col int) float64
- func (table *Table) NewCell() *TableCell
- func (table *Table) NewCellByRange(w, h int) *TableCell
- func (table *Table) SetLineHeight(lineHeight float64)
- func (table *Table) SetMargin(margin core.Scope)
- type TableCell
- type TextCell
- func (cell *TextCell) Copy(content string) *TextCell
- func (cell *TextCell) GenerateAtomicCell(maxheight float64) (int, int, error)
- func (cell *TextCell) GetHeight() float64
- func (cell *TextCell) GetLastHeight() float64
- func (cell *TextCell) HorizontalCentered() *TextCell
- func (cell *TextCell) RightAlign() *TextCell
- func (cell *TextCell) SetBackColor(color string) *TextCell
- func (cell *TextCell) SetBorder(border core.Scope) *TextCell
- func (cell *TextCell) SetContent(s string) *TextCell
- func (cell *TextCell) SetFont(font core.Font) *TextCell
- func (cell *TextCell) SetFontColor(color string) *TextCell
- func (cell *TextCell) SetFontWithColor(font core.Font, color string) *TextCell
- func (cell *TextCell) TryGenerateAtomicCell(maxheight float64) (int, int)
- func (cell *TextCell) VerticalCentered() *TextCell
- type Token
Constants ¶
View Source
const ( DIV_STRAIGHT = 1 // 实线边框 DIV_DASHED = 2 // 虚线边框 DIV_DOTTED = 3 // 点状线的边框 DIV_NONE = 4 // 无边框 )
View Source
const ( FONT_NORMAL = "normal" FONT_BOLD = "bold" FONT_IALIC = "italic" )
View Source
const ( TYPE_TEXT = "text" TYPE_STRONG = "strong" // **strong** TYPE_EM = "em" // *em* TYPE_CODESPAN = "codespan" // `codespan`, “`codespan“` TYPE_CODE = "code" // TYPE_LINK = "link" // [xx](http://www.link) TYPE_IMAGE = "image" // ![xxx](https://www.image) TYPE_SPACE = "space" TYPE_PARAGRAPH = "paragraph" TYPE_HEADING = "heading" TYPE_LIST = "list" TYPE_BLOCKQUOTE = "blockquote" )
View Source
const ( PNG = "png" BMP = "bmp" WEBP = "webp" TIFF = "tiff" JPEG = "jpeg" )
Variables ¶
This section is empty.
Functions ¶
func Convert2JPEG ¶
func ConvertBMP2JPEG ¶
func ConvertPNG2JPEG ¶
func ConvertTIFF2JPEG ¶
func ConvertWEBP2JPEG ¶
func DrawFiveCycle ¶
func DrawFiveCycle(srcPath string)
func DrawInnerFiveCycle ¶
func DrawInnerFiveCycle(srcPath string)
func DrawPlumCurve ¶
func DrawPlumCurve(srcPath string)
func DrawRotationOutCircle ¶
func DrawRotationOutCircle(srcPath string)
func DrawSunLine ¶
func DrawSunLine(srcPath string)
func GetImageWidthAndHeight ¶
Types ¶
type Div ¶
type Div struct {
// contains filtered or unexported fields
}
带有各种边框的内容, 可以自动换行
func NewDivWithWidth ¶
func (*Div) HorizontalCentered ¶
func (*Div) RightAlign ¶
func (*Div) SetBackColor ¶
func (*Div) SetContent ¶
func (*Div) SetFontColor ¶
func (*Div) SetFrameType ¶
type HLine ¶
type HLine struct {
// contains filtered or unexported fields
}
func (*HLine) GenerateAtomicCell ¶
func (h *HLine) GenerateAtomicCell()
type Image ¶
type Image struct {
// contains filtered or unexported fields
}
func (*Image) GenerateAtomicCell ¶
自动换行
func (*Image) SetAutoBreak ¶
func (image *Image) SetAutoBreak()
type MarkdownText ¶
type MarkdownText struct {
// contains filtered or unexported fields
}
func NewMarkdownText ¶
func (*MarkdownText) GenerateAtomicCell ¶
func (mt *MarkdownText) GenerateAtomicCell() (err error)
func (*MarkdownText) SetTokens ¶
func (mt *MarkdownText) SetTokens(tokens []Token)
type MdBlockQuote ¶
type MdBlockQuote struct {
// contains filtered or unexported fields
}
func (*MdBlockQuote) GenerateAtomicCell ¶
func (*MdBlockQuote) SetToken ¶
func (b *MdBlockQuote) SetToken(t Token) error
type MdHeader ¶
type MdHeader struct {
// contains filtered or unexported fields
}
func (*MdHeader) CalFontSizeAndLineHeight ¶
func (*MdHeader) GenerateAtomicCell ¶
type MdImage ¶
type MdImage struct {
// contains filtered or unexported fields
}
func (*MdImage) GenerateAtomicCell ¶
type MdList ¶
type MdList struct {
// contains filtered or unexported fields
}
func (*MdList) GenerateAtomicCell ¶
type MdMutiText ¶
type MdMutiText struct {
// contains filtered or unexported fields
}
func (*MdMutiText) GenerateAtomicCell ¶
func (*MdMutiText) SetToken ¶
func (m *MdMutiText) SetToken(t Token) error
type MdParagraph ¶
type MdParagraph struct {
// contains filtered or unexported fields
}
func (*MdParagraph) GenerateAtomicCell ¶
func (p *MdParagraph) GenerateAtomicCell() (pagebreak, over bool, err error)
func (*MdParagraph) SetToken ¶
func (p *MdParagraph) SetToken(t Token) error
type MdSpace ¶
type MdSpace struct {
// contains filtered or unexported fields
}
func (*MdSpace) GenerateAtomicCell ¶
type MdText ¶
type MdText struct {
// contains filtered or unexported fields
}
Atomic component
func (*MdText) GenerateAtomicCell ¶
func (*MdText) GetSubText ¶
GetSubText, Returns the content of a string of length x2-x1. This string is a substring of text. After return, the remain and length will change
type Span ¶
type Span struct {
// contains filtered or unexported fields
}
不会进行自动分页, 可以用于页眉, 页脚的内容.
func NewSpanWithWidth ¶
func (*Span) GenerateAtomicCell ¶
func (*Span) HorizontalCentered ¶
func (*Span) RightAlign ¶
func (*Span) SetContent ¶
func (*Span) SetFontColor ¶
func (*Span) SetFontWithColor ¶
func (*Span) VerticalCentered ¶
type Table ¶
type Table struct {
// contains filtered or unexported fields
}
构建表格
func (*Table) GenerateAtomicCell ¶
func (*Table) SetLineHeight ¶
设置表的行高, 行高必须大于当前使用字体的行高
type TextCell ¶
type TextCell struct {
// contains filtered or unexported fields
}
func NewTextCell ¶
func (*TextCell) GenerateAtomicCell ¶
先涂背景颜色, 然后在背景颜色的基础上写入内容
func (*TextCell) GetLastHeight ¶
func (*TextCell) HorizontalCentered ¶
func (*TextCell) RightAlign ¶
func (*TextCell) SetBackColor ¶
func (*TextCell) SetContent ¶
func (*TextCell) SetFontColor ¶
func (*TextCell) SetFontWithColor ¶
func (*TextCell) TryGenerateAtomicCell ¶
func (*TextCell) VerticalCentered ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.