mirror of
https://github.com/fumiama/go-docx.git
synced 2026-06-12 11:40:28 +08:00
add font to run
This commit is contained in:
25
apirun.go
25
apirun.go
@@ -58,7 +58,20 @@ func (r *Run) Italic() *Run {
|
||||
return r
|
||||
}
|
||||
|
||||
// Underline ...
|
||||
// Underline has several possible values including
|
||||
//
|
||||
// none: Specifies that no underline should be applied.
|
||||
// single: Specifies a single underline.
|
||||
// words: Specifies that only words within the text should be underlined.
|
||||
// double: Specifies a double underline.
|
||||
// thick: Specifies a thick underline.
|
||||
// dotted: Specifies a dotted underline.
|
||||
// dash: Specifies a dash underline.
|
||||
// dotDash: Specifies an alternating dot-dash underline.
|
||||
// dotDotDash: Specifies an alternating dot-dot-dash underline.
|
||||
// wave: Specifies a wavy underline.
|
||||
// dashLong: Specifies a long dash underline.
|
||||
// wavyDouble: Specifies a double wavy underline.
|
||||
func (r *Run) Underline(val string) *Run {
|
||||
r.RunProperties.Underline = &Underline{Val: val}
|
||||
return r
|
||||
@@ -75,3 +88,13 @@ func (r *Run) AddTab() *Run {
|
||||
r.Children = append(r.Children, &Tab{})
|
||||
return r
|
||||
}
|
||||
|
||||
// Font sets the font of the run
|
||||
func (r *Run) Font(ascii, hansi, hint string) *Run {
|
||||
r.RunProperties.Fonts = &RunFonts{
|
||||
Ascii: ascii,
|
||||
HAnsi: hansi,
|
||||
Hint: hint,
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user