Class: BerkeleyLibrary::Util::ODS::XML::Style::FontFace
- Inherits:
-
ElementNode
- Object
- ElementNode
- BerkeleyLibrary::Util::ODS::XML::Style::FontFace
- Defined in:
- lib/berkeley_library/util/ods/xml/style/font_face.rb
Constant Summary collapse
- DEFAULT_FONT_FACE =
'Liberation Sans'.freeze
Instance Attribute Summary collapse
-
#family_generic ⇒ Object
readonly
Returns the value of attribute family_generic.
-
#font_pitch ⇒ Object
readonly
Returns the value of attribute font_pitch.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#svg_family ⇒ Object
readonly
Returns the value of attribute svg_family.
Attributes inherited from ElementNode
#doc, #element_name, #namespace
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(name, doc:, svg_family: nil, family_generic: nil, font_pitch: nil) ⇒ FontFace
constructor
A new instance of FontFace.
Methods inherited from ElementNode
#add_child, #attributes, #children, #clear_attribute, #create_element, #element, #ensure_element!, #prefix, #prefixed_attr_name, #set_attribute
Constructor Details
#initialize(name, doc:, svg_family: nil, family_generic: nil, font_pitch: nil) ⇒ FontFace
Returns a new instance of FontFace.
13 14 15 16 17 18 19 20 |
# File 'lib/berkeley_library/util/ods/xml/style/font_face.rb', line 13 def initialize(name, doc:, svg_family: nil, family_generic: nil, font_pitch: nil) super(:style, 'font-face', doc: doc) set_attribute('name', name) set_attribute(:svg, 'font-family', svg_family || to_family(name)) set_attribute('font-family-generic', family_generic) if family_generic set_attribute('font-pitch', font_pitch) if font_pitch end |
Instance Attribute Details
#family_generic ⇒ Object (readonly)
Returns the value of attribute family_generic.
11 12 13 |
# File 'lib/berkeley_library/util/ods/xml/style/font_face.rb', line 11 def family_generic @family_generic end |
#font_pitch ⇒ Object (readonly)
Returns the value of attribute font_pitch.
11 12 13 |
# File 'lib/berkeley_library/util/ods/xml/style/font_face.rb', line 11 def font_pitch @font_pitch end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
11 12 13 |
# File 'lib/berkeley_library/util/ods/xml/style/font_face.rb', line 11 def name @name end |
#svg_family ⇒ Object (readonly)
Returns the value of attribute svg_family.
11 12 13 |
# File 'lib/berkeley_library/util/ods/xml/style/font_face.rb', line 11 def svg_family @svg_family end |
Class Method Details
.default_face(doc:) ⇒ Object
23 24 25 |
# File 'lib/berkeley_library/util/ods/xml/style/font_face.rb', line 23 def default_face(doc:) FontFace.new(FontFace::DEFAULT_FONT_FACE, family_generic: 'swiss', font_pitch: 'variable', doc: doc) end |