Class: Uniword::Wordprocessingml::CharacterStyle

Inherits:
Object
  • Object
show all
Defined in:
lib/uniword/wordprocessingml/character_style.rb

Overview

Factory class for creating character Style instances

Provides factory methods for common character styles like DefaultParagraphFont, Emphasis, Strong, etc.

Class Method Summary collapse

Class Method Details

.book_titleStyle

Create a Book Title character style

Returns:

  • (Style)

    Book Title style instance



153
154
155
156
157
158
159
160
161
162
163
164
165
# File 'lib/uniword/wordprocessingml/character_style.rb', line 153

def self.book_title
  Style.new(
    type: "character",
    styleId: "BookTitle",
    name: StyleName.new(val: "Book Title"),
    customStyle: true,
    rPr: RunProperties.new(
      italic: Properties::Italic.new,
      fonts: Properties::RunFonts.new(ascii: "Constantia",
                                      h_ansi: "Constantia"),
    ),
  )
end

.default_charStyle

Create the default character style

Returns:

  • (Style)

    Default character style instance



13
14
15
16
17
18
19
20
# File 'lib/uniword/wordprocessingml/character_style.rb', line 13

def self.default_char
  Style.new(
    type: "character",
    styleId: "DefaultParagraphFont",
    name: StyleName.new(val: "Default Paragraph Font"),
    default: true,
  )
end

.emphasisStyle

Create an Emphasis character style (italic)

Returns:

  • (Style)

    Emphasis style instance



25
26
27
28
29
30
31
32
33
34
35
# File 'lib/uniword/wordprocessingml/character_style.rb', line 25

def self.emphasis
  Style.new(
    type: "character",
    styleId: "Emphasis",
    name: StyleName.new(val: "Emphasis"),
    customStyle: true,
    rPr: RunProperties.new(
      italic: Properties::Italic.new,
    ),
  )
end

Create a Followed Hyperlink character style

Returns:

  • (Style)

    Followed Hyperlink style instance



186
187
188
189
190
191
192
193
194
195
196
197
# File 'lib/uniword/wordprocessingml/character_style.rb', line 186

def self.followed_hyperlink
  Style.new(
    type: "character",
    styleId: "FollowedHyperlink",
    name: StyleName.new(val: "Followed Hyperlink"),
    customStyle: true,
    rPr: RunProperties.new(
      color: Properties::ColorValue.new(value: "800080"),
      underline: Properties::Underline.new(value: "single"),
    ),
  )
end

Create a Hyperlink character style

Returns:

  • (Style)

    Hyperlink style instance



170
171
172
173
174
175
176
177
178
179
180
181
# File 'lib/uniword/wordprocessingml/character_style.rb', line 170

def self.hyperlink
  Style.new(
    type: "character",
    styleId: "Hyperlink",
    name: StyleName.new(val: "Hyperlink"),
    customStyle: true,
    rPr: RunProperties.new(
      color: Properties::ColorValue.new(value: "0000FF"),
      underline: Properties::Underline.new(value: "single"),
    ),
  )
end

.intense_emphasisStyle

Create an Intense Emphasis character style

Returns:

  • (Style)

    Intense Emphasis style instance



71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/uniword/wordprocessingml/character_style.rb', line 71

def self.intense_emphasis
  Style.new(
    type: "character",
    styleId: "IntenseEmphasis",
    name: StyleName.new(val: "Intense Emphasis"),
    customStyle: true,
    rPr: RunProperties.new(
      italic: Properties::Italic.new,
      bold: Properties::Bold.new,
      color: Properties::ColorValue.new(value: "2E74B5"),
    ),
  )
end

.intense_quote_charStyle

Create an Intense Quote character style

Returns:

  • (Style)

    Intense Quote character style instance



104
105
106
107
108
109
110
111
112
113
114
115
116
# File 'lib/uniword/wordprocessingml/character_style.rb', line 104

def self.intense_quote_char
  Style.new(
    type: "character",
    styleId: "IntenseQuoteChar",
    name: StyleName.new(val: "Intense Quote Char"),
    basedOn: BasedOn.new(val: "DefaultParagraphFont"),
    customStyle: true,
    rPr: RunProperties.new(
      italic: Properties::Italic.new,
      bold: Properties::Bold.new,
    ),
  )
end

.intense_referenceStyle

Create an Intense Reference character style

Returns:

  • (Style)

    Intense Reference style instance



137
138
139
140
141
142
143
144
145
146
147
148
# File 'lib/uniword/wordprocessingml/character_style.rb', line 137

def self.intense_reference
  Style.new(
    type: "character",
    styleId: "IntenseReference",
    name: StyleName.new(val: "Intense Reference"),
    customStyle: true,
    rPr: RunProperties.new(
      bold: Properties::Bold.new,
      color: Properties::ColorValue.new(value: "2E74B5"),
    ),
  )
end

.quote_charStyle

Create a Quote character style

Returns:

  • (Style)

    Quote character style instance



88
89
90
91
92
93
94
95
96
97
98
99
# File 'lib/uniword/wordprocessingml/character_style.rb', line 88

def self.quote_char
  Style.new(
    type: "character",
    styleId: "QuoteChar",
    name: StyleName.new(val: "Quote Char"),
    basedOn: BasedOn.new(val: "DefaultParagraphFont"),
    customStyle: true,
    rPr: RunProperties.new(
      italic: Properties::Italic.new,
    ),
  )
end

.strongStyle

Create a Strong character style (bold)

Returns:

  • (Style)

    Strong style instance



40
41
42
43
44
45
46
47
48
49
50
# File 'lib/uniword/wordprocessingml/character_style.rb', line 40

def self.strong
  Style.new(
    type: "character",
    styleId: "Strong",
    name: StyleName.new(val: "Strong"),
    customStyle: true,
    rPr: RunProperties.new(
      bold: Properties::Bold.new,
    ),
  )
end

.subtle_emphasisStyle

Create a Subtle Emphasis character style

Returns:

  • (Style)

    Subtle Emphasis style instance



55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/uniword/wordprocessingml/character_style.rb', line 55

def self.subtle_emphasis
  Style.new(
    type: "character",
    styleId: "SubtleEmphasis",
    name: StyleName.new(val: "Subtle Emphasis"),
    customStyle: true,
    rPr: RunProperties.new(
      italic: Properties::Italic.new,
      color: Properties::ColorValue.new(value: "595959"),
    ),
  )
end

.subtle_referenceStyle

Create a Subtle Reference character style

Returns:

  • (Style)

    Subtle Reference style instance



121
122
123
124
125
126
127
128
129
130
131
132
# File 'lib/uniword/wordprocessingml/character_style.rb', line 121

def self.subtle_reference
  Style.new(
    type: "character",
    styleId: "SubtleReference",
    name: StyleName.new(val: "Subtle Reference"),
    customStyle: true,
    rPr: RunProperties.new(
      italic: Properties::Italic.new,
      color: Properties::ColorValue.new(value: "595959"),
    ),
  )
end