docx_generator 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +18 -18
- data/.rspec +1 -0
- data/Gemfile +6 -4
- data/Guardfile +11 -11
- data/LICENSE.txt +22 -22
- data/README.md +41 -41
- data/Rakefile +7 -7
- data/docx_generator.gemspec +36 -36
- data/examples/basic_document_with_blocks.rb +40 -36
- data/examples/basic_document_without_blocks.rb +9 -9
- data/generators.thor +10 -0
- data/generators/word_base.rb +106 -0
- data/lib/docx_generator.rb +9 -9
- data/lib/docx_generator/dsl.rb +9 -9
- data/lib/docx_generator/dsl/document.rb +84 -75
- data/lib/docx_generator/dsl/paragraph.rb +125 -72
- data/lib/docx_generator/dsl/text.rb +121 -71
- data/lib/docx_generator/element.rb +52 -52
- data/lib/docx_generator/version.rb +4 -4
- data/lib/docx_generator/word.rb +8 -8
- data/lib/docx_generator/word/base.rb +83 -82
- data/lib/docx_generator/word/extensions.rb +30 -18
- data/lib/docx_generator/word/formatting.rb +162 -58
- data/spec/docx_generator/dsl/document_spec.rb +89 -89
- data/spec/docx_generator/dsl/paragraph_spec.rb +107 -71
- data/spec/docx_generator/dsl/text_spec.rb +91 -65
- data/spec/docx_generator/element_spec.rb +44 -44
- data/spec/docx_generator/word/base_spec.rb +57 -57
- data/spec/docx_generator/word/extensions_spec.rb +15 -15
- data/spec/docx_generator/word/formatting_spec.rb +89 -41
- data/spec/spec_helper.rb +7 -7
- metadata +29 -55
- data/.rvmrc +0 -60
@@ -1,52 +1,52 @@
|
|
1
|
-
module DocxGenerator
|
2
|
-
|
3
|
-
# Represent an XML element. This class should not be used directly by the users of the library.
|
4
|
-
class Element
|
5
|
-
|
6
|
-
# Create a new XML element.
|
7
|
-
# @param name [String] The name of the XML element.
|
8
|
-
# @param attributes [Hash] The attributes of the XML element.
|
9
|
-
# @param content [Array] An array of the children of the XML element (other XML elements).
|
10
|
-
def initialize(name, attributes = {}, content = [])
|
11
|
-
@name = name
|
12
|
-
@attributes = attributes
|
13
|
-
@content = content
|
14
|
-
end
|
15
|
-
|
16
|
-
# Add an XML element in the content of this XML element.
|
17
|
-
# @param element[DocxGenerator::Element] The XML element to add.
|
18
|
-
def add(element)
|
19
|
-
@content << element
|
20
|
-
end
|
21
|
-
|
22
|
-
# Generate the XML for the element.
|
23
|
-
# @return [String] The XML produced for the element.
|
24
|
-
def generate
|
25
|
-
output = ""
|
26
|
-
if @content.length != 0
|
27
|
-
output += "<#{@name}#{generate_attributes}>"
|
28
|
-
@content.each do |element|
|
29
|
-
if element.respond_to?(:generate)
|
30
|
-
output += element.generate
|
31
|
-
else
|
32
|
-
output += element.to_s
|
33
|
-
end
|
34
|
-
end
|
35
|
-
output += "</#{@name}>"
|
36
|
-
else
|
37
|
-
output += "<#{@name}#{generate_attributes} />"
|
38
|
-
end
|
39
|
-
output
|
40
|
-
end
|
41
|
-
alias :to_s :generate
|
42
|
-
|
43
|
-
private
|
44
|
-
def generate_attributes
|
45
|
-
output = ""
|
46
|
-
@attributes.each do |name, value|
|
47
|
-
output += " #{name}=\"#{value}\""
|
48
|
-
end
|
49
|
-
output
|
50
|
-
end
|
51
|
-
end
|
52
|
-
end
|
1
|
+
module DocxGenerator
|
2
|
+
|
3
|
+
# Represent an XML element. This class should not be used directly by the users of the library.
|
4
|
+
class Element
|
5
|
+
|
6
|
+
# Create a new XML element.
|
7
|
+
# @param name [String] The name of the XML element.
|
8
|
+
# @param attributes [Hash] The attributes of the XML element.
|
9
|
+
# @param content [Array] An array of the children of the XML element (other XML elements).
|
10
|
+
def initialize(name, attributes = {}, content = [])
|
11
|
+
@name = name
|
12
|
+
@attributes = attributes
|
13
|
+
@content = content
|
14
|
+
end
|
15
|
+
|
16
|
+
# Add an XML element in the content of this XML element.
|
17
|
+
# @param element[DocxGenerator::Element] The XML element to add.
|
18
|
+
def add(element)
|
19
|
+
@content << element
|
20
|
+
end
|
21
|
+
|
22
|
+
# Generate the XML for the element.
|
23
|
+
# @return [String] The XML produced for the element.
|
24
|
+
def generate
|
25
|
+
output = ""
|
26
|
+
if @content.length != 0
|
27
|
+
output += "<#{@name}#{generate_attributes}>"
|
28
|
+
@content.each do |element|
|
29
|
+
if element.respond_to?(:generate)
|
30
|
+
output += element.generate
|
31
|
+
else
|
32
|
+
output += element.to_s
|
33
|
+
end
|
34
|
+
end
|
35
|
+
output += "</#{@name}>"
|
36
|
+
else
|
37
|
+
output += "<#{@name}#{generate_attributes} />"
|
38
|
+
end
|
39
|
+
output
|
40
|
+
end
|
41
|
+
alias :to_s :generate
|
42
|
+
|
43
|
+
private
|
44
|
+
def generate_attributes
|
45
|
+
output = ""
|
46
|
+
@attributes.each do |name, value|
|
47
|
+
output += " #{name}=\"#{value}\""
|
48
|
+
end
|
49
|
+
output
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
module DocxGenerator
|
2
|
-
# Version of DocxGenerator.
|
3
|
-
VERSION = "0.1.
|
4
|
-
end
|
1
|
+
module DocxGenerator
|
2
|
+
# Version of DocxGenerator.
|
3
|
+
VERSION = "0.1.1"
|
4
|
+
end
|
data/lib/docx_generator/word.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
-
require 'docx_generator/word/base'
|
2
|
-
require 'docx_generator/word/extensions'
|
3
|
-
require 'docx_generator/word/formatting'
|
4
|
-
|
5
|
-
module DocxGenerator
|
6
|
-
# Namesapce for all XML Elements defined in the standard.
|
7
|
-
module Word
|
8
|
-
end
|
1
|
+
require 'docx_generator/word/base'
|
2
|
+
require 'docx_generator/word/extensions'
|
3
|
+
require 'docx_generator/word/formatting'
|
4
|
+
|
5
|
+
module DocxGenerator
|
6
|
+
# Namesapce for all XML Elements defined in the standard.
|
7
|
+
module Word
|
8
|
+
end
|
9
9
|
end
|
@@ -1,82 +1,83 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
#
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
#
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
#
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
#
|
66
|
-
# @param
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
class
|
74
|
-
|
75
|
-
#
|
76
|
-
# @param
|
77
|
-
def initialize(attributes = {})
|
78
|
-
super("w:br", attributes)
|
79
|
-
end
|
80
|
-
end
|
81
|
-
|
82
|
-
end
|
1
|
+
# Warning: This file has been automatically generated from generator/word_base.rb.
|
2
|
+
# It should not be edited by hand. Instead, modify the code generator.
|
3
|
+
|
4
|
+
module DocxGenerator
|
5
|
+
module Word
|
6
|
+
# Represent the `w:document` element from Office Open XML specification. This class should not be used directly by the users of the library.
|
7
|
+
class Document < Element
|
8
|
+
# Create a new `w:document` XML element.
|
9
|
+
# @param attributes [Hash] The attributes of the XML element. Check the specification of the `w:document` element for the possible attributes.
|
10
|
+
# @param content [Array] An array of the children of the XML element (other XML elements).
|
11
|
+
def initialize(attributes = {}, content = [])
|
12
|
+
super("w:document", attributes, content)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
# Represent the `w:body` element from Office Open XML specification. This class should not be used directly by the users of the library.
|
17
|
+
class Body < Element
|
18
|
+
# Create a new `w:body` XML element.
|
19
|
+
# @param content [Array] An array of the children of the XML element (other XML elements).
|
20
|
+
def initialize(content = [])
|
21
|
+
super("w:body", {}, content)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
# Represent the `w:p` element from Office Open XML specification. This class should not be used directly by the users of the library.
|
26
|
+
class Paragraph < Element
|
27
|
+
# Create a new `w:p` XML element.
|
28
|
+
# @param attributes [Hash] The attributes of the XML element. Check the specification of the `w:p` element for the possible attributes.
|
29
|
+
# @param content [Array] An array of the children of the XML element (other XML elements).
|
30
|
+
def initialize(attributes = {}, content = [])
|
31
|
+
super("w:p", attributes, content)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
# Represent the `w:pPr` element from Office Open XML specification. This class should not be used directly by the users of the library.
|
36
|
+
class ParagraphProperties < Element
|
37
|
+
# Create a new `w:pPr` XML element.
|
38
|
+
# @param content [Array] An array of the children of the XML element (other XML elements).
|
39
|
+
def initialize(content = [])
|
40
|
+
super("w:pPr", {}, content)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
# Represent the `w:r` element from Office Open XML specification. This class should not be used directly by the users of the library.
|
45
|
+
class Run < Element
|
46
|
+
# Create a new `w:r` XML element.
|
47
|
+
# @param attributes [Hash] The attributes of the XML element. Check the specification of the `w:r` element for the possible attributes.
|
48
|
+
# @param content [Array] An array of the children of the XML element (other XML elements).
|
49
|
+
def initialize(attributes = {}, content = [])
|
50
|
+
super("w:r", attributes, content)
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
# Represent the `w:rPr` element from Office Open XML specification. This class should not be used directly by the users of the library.
|
55
|
+
class RunProperties < Element
|
56
|
+
# Create a new `w:rPr` XML element.
|
57
|
+
# @param content [Array] An array of the children of the XML element (other XML elements).
|
58
|
+
def initialize(content = [])
|
59
|
+
super("w:rPr", {}, content)
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
# Represent the `w:t` element from Office Open XML specification. This class should not be used directly by the users of the library.
|
64
|
+
class Text < Element
|
65
|
+
# Create a new `w:t` XML element.
|
66
|
+
# @param attributes [Hash] The attributes of the XML element. Check the specification of the `w:t` element for the possible attributes.
|
67
|
+
# @param content [Array] An array of the children of the XML element (other XML elements).
|
68
|
+
def initialize(attributes = {}, content = [])
|
69
|
+
super("w:t", attributes, content)
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
# Represent the `w:br` element from Office Open XML specification. This class should not be used directly by the users of the library.
|
74
|
+
class Break < Element
|
75
|
+
# Create a new `w:br` XML element.
|
76
|
+
# @param attributes [Hash] The attributes of the XML element. Check the specification of the `w:br` element for the possible attributes.
|
77
|
+
def initialize(attributes = {})
|
78
|
+
super("w:br", attributes)
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
end
|
83
|
+
end
|
@@ -1,18 +1,30 @@
|
|
1
|
-
module DocxGenerator
|
2
|
-
module Word
|
3
|
-
|
4
|
-
# Extensions to create some common elements easily.
|
5
|
-
module Extensions
|
6
|
-
def self.space
|
7
|
-
DocxGenerator::Word::Run.new({}, [DocxGenerator::Word::Text.new({ "xml:space" => "preserve" }, [" "])])
|
8
|
-
end
|
9
|
-
|
10
|
-
def self.newline
|
11
|
-
DocxGenerator::Word::Run.new({}, [DocxGenerator::Word::Break.new])
|
12
|
-
end
|
13
|
-
|
14
|
-
class
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
end
|
1
|
+
module DocxGenerator
|
2
|
+
module Word
|
3
|
+
|
4
|
+
# Extensions to create some common elements easily.
|
5
|
+
module Extensions
|
6
|
+
def self.space
|
7
|
+
DocxGenerator::Word::Run.new({}, [DocxGenerator::Word::Text.new({ "xml:space" => "preserve" }, [" "])])
|
8
|
+
end
|
9
|
+
|
10
|
+
def self.newline
|
11
|
+
DocxGenerator::Word::Run.new({}, [DocxGenerator::Word::Break.new])
|
12
|
+
end
|
13
|
+
|
14
|
+
class Newline
|
15
|
+
def generate
|
16
|
+
DocxGenerator::Word::Run.new({}, [DocxGenerator::Word::Break.new])
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
class Tab
|
21
|
+
def generate
|
22
|
+
DocxGenerator::Word::Run.new({}, [DocxGenerator::Word::Tab.new])
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
class NoSpace
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -1,58 +1,162 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
class
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
end
|
1
|
+
# This file should be standarized. All the parameters should be named parameters (or maybe only those who take a Hash).
|
2
|
+
# All they do is arguments tranformations and they document possible arguments from the specification.
|
3
|
+
|
4
|
+
module DocxGenerator
|
5
|
+
module Word
|
6
|
+
# Represent the `w:b` element from Office Open XML specification. This class should not be used directly by the users of the library.
|
7
|
+
class Bold < Element
|
8
|
+
# Create a new `w:b` element.
|
9
|
+
# @param present [Boolean] If bold should be applied to the text.
|
10
|
+
def initialize(present = nil)
|
11
|
+
arguments = (present == nil ? {} : { "w:val" => present })
|
12
|
+
super("w:b", arguments)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
# Represent the `w:i` element from Office Open XML specification. This class should not be used directly by the users of the library.
|
17
|
+
class Italics < Element
|
18
|
+
# Create a new `w:i` element.
|
19
|
+
# @param present [Boolean] If italics should be applied to the text.
|
20
|
+
def initialize(present = nil)
|
21
|
+
arguments = (present == nil ? {} : { "w:val" => present })
|
22
|
+
super("w:i", arguments)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
# Represent the `w:u` element from Office Open XML specification. This class should not be used directly by the users of the library.
|
27
|
+
class Underline < Element
|
28
|
+
# Create a new `w:u` element.
|
29
|
+
# @param arguments [Hash] Arguments for the `w:u` element. See the full list in the specification. You can use `style` instead of `w:val` if you want. The list of all underline patterns can be found in the specification.
|
30
|
+
def initialize(arguments = { "w:val" => "single" })
|
31
|
+
final_arguments = {}
|
32
|
+
arguments.each do |option, value|
|
33
|
+
case option
|
34
|
+
when :style then final_arguments["w:val"] = value
|
35
|
+
else final_arguments[option] = value
|
36
|
+
end
|
37
|
+
end
|
38
|
+
super("w:u", final_arguments)
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
# Represent the `w:sz` element from Office Open XML specification. This class should not be used directly by the users of the library.
|
43
|
+
class Size < Element
|
44
|
+
# Create a new `w:sz` element.
|
45
|
+
# @param size [Number] The size of the text (in points)
|
46
|
+
def initialize(size)
|
47
|
+
super("w:sz", { "w:val" => size*2 })
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
# Represent the `w:jc` element from Office Open XML specification. This class should not be used directly by the users of the library.
|
52
|
+
class Alignment < Element
|
53
|
+
# Create a new `w:jc` element.
|
54
|
+
# @param value [String] The type of alignment. The list of all types of alignment can be found in the specification.
|
55
|
+
def initialize(value)
|
56
|
+
super("w:jc", { "w:val" => value })
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
# Represent the `w:spacing` element from Office Open XML specification. This class should not be used directly by the users of the library.
|
61
|
+
class Spacing < Element
|
62
|
+
# Create a new `w:spacing` element.
|
63
|
+
# @param arguments [Hash] The different options for the spacing. They can be found in the specification.
|
64
|
+
def initialize(arguments = {})
|
65
|
+
final_arguments = {}
|
66
|
+
arguments.each do |name, value|
|
67
|
+
if name.to_s == "after" || name.to_s == "before"
|
68
|
+
final_arguments["w:" + name.to_s] = (value * 20).round
|
69
|
+
else
|
70
|
+
final_arguments["w:" + name.to_s] = (value * 20 * 12).round
|
71
|
+
final_arguments["w:lineRule"] = "auto"
|
72
|
+
end
|
73
|
+
end
|
74
|
+
super("w:spacing", final_arguments)
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
# Represent the `w:indent` element from Office Open XML specification. This class should not be used directly by the users of the library.
|
79
|
+
class Indentation < Element
|
80
|
+
# Create a new `w:indent` element.
|
81
|
+
# @param properties [Hash] The different properties for the indentation. They can be found in the specification.
|
82
|
+
def initialize(arguments = {})
|
83
|
+
final_arguments = {}
|
84
|
+
arguments.each do |name, value|
|
85
|
+
if name.to_s == "first_line"
|
86
|
+
final_arguments["w:firstLine"] = (value * 20).round
|
87
|
+
else
|
88
|
+
final_arguments["w:" + name.to_s] = (value * 20).round
|
89
|
+
end
|
90
|
+
end
|
91
|
+
super("w:ind", final_arguments)
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
# Represent the `w:tabs` element from Office Open XML specification. This class should not be used directly by the users of the library.
|
96
|
+
class Tabs < Element
|
97
|
+
# Create a new `w:tabs` element.
|
98
|
+
# @param tab_stops [Array] The tab stops.
|
99
|
+
def initialize(tab_stops)
|
100
|
+
tab_stop_elements = tab_stops.inject([]) do |tab_stop_elements, tab_stop|
|
101
|
+
tab_stop_elements << Tab.new(tab_stop)
|
102
|
+
end
|
103
|
+
super("w:tabs", {}, tab_stop_elements)
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
107
|
+
# Represent the `w:tab` element from Office Open XML specification. This class should not be used directly by the users of the library.
|
108
|
+
class Tab < Element
|
109
|
+
# Create a new `w:tab` element.
|
110
|
+
# @param options [Hash] Options for the tab stop. Must be `leader`, `pos` or `val`. See the specification for the possible values for each option.
|
111
|
+
def initialize(options = {})
|
112
|
+
final_arguments = {}
|
113
|
+
options.each do |name, value|
|
114
|
+
if name.to_s == "pos"
|
115
|
+
final_arguments["w:pos"] = (value * 20).round
|
116
|
+
else
|
117
|
+
final_arguments["w:" + name.to_s] = value
|
118
|
+
end
|
119
|
+
end
|
120
|
+
super("w:tab", final_arguments)
|
121
|
+
end
|
122
|
+
end
|
123
|
+
|
124
|
+
# Represent the `w:vertAlign` element from Office Open XML specification. This class should not be used directly by the users of the library.
|
125
|
+
class VerticalAlign < Element
|
126
|
+
# Create a new `w:vertAlign` element.
|
127
|
+
# @param value [String] The type of alignment. It should be `baseline`, `subscript` or `superscript`.
|
128
|
+
def initialize(value)
|
129
|
+
super("w:vertAlign", { "w:val" => value })
|
130
|
+
end
|
131
|
+
end
|
132
|
+
|
133
|
+
# Represent the `w:caps` element from Office Open XML specification. This class should not be used directly by the users of the library.
|
134
|
+
class CapitalLetters < Element
|
135
|
+
# Create a new `w:caps` element.
|
136
|
+
# @param present [Boolean] If the text should be displayed in capital letters.
|
137
|
+
def initialize(present = nil)
|
138
|
+
arguments = (present == nil ? {} : { "w:val" => present })
|
139
|
+
super("w:caps", arguments)
|
140
|
+
end
|
141
|
+
end
|
142
|
+
|
143
|
+
# Represent the `w:smallCaps` element from Office Open XML specification. This class should not be used directly by the users of the library.
|
144
|
+
class SmallCapitalLetters < Element
|
145
|
+
# Create a new `w:smallCaps` element.
|
146
|
+
# @param present [Boolean] If the text should be displayed in small capital letters.
|
147
|
+
def initialize(present = nil)
|
148
|
+
arguments = (present == nil ? {} : { "w:val" => present })
|
149
|
+
super("w:smallCaps", arguments)
|
150
|
+
end
|
151
|
+
end
|
152
|
+
|
153
|
+
# Represent the `w:rFonts` element from Office Open XML specification. This class should not be used directly by the users of the library.
|
154
|
+
class Font < Element
|
155
|
+
# Create a new `w:rFonts` element.
|
156
|
+
# @param name [String] The name of the font.
|
157
|
+
def initialize(name)
|
158
|
+
super("w:rFonts", { "w:ascii" => name })
|
159
|
+
end
|
160
|
+
end
|
161
|
+
end
|
162
|
+
end
|