Class: CTioga2::Graphics::Styles::LaTeXFont
- Inherits:
-
Object
- Object
- CTioga2::Graphics::Styles::LaTeXFont
- Defined in:
- lib/ctioga2/graphics/styles/texts.rb
Overview
TODO:
Deprecate in favor of the latter class
A LaTeX font. It should be applied to text using the function #fontify.
todo add real font attributes (family, and so on…)
Instance Attribute Summary collapse
-
#font_command ⇒ Object
The font command (bf, sf…).
Class Method Summary collapse
Instance Method Summary collapse
-
#fontify(txt) ⇒ Object
Returns text wrapping txt with the appropriate functions to get the appropriate font in LaTeX.
-
#initialize ⇒ LaTeXFont
constructor
A new instance of LaTeXFont.
Constructor Details
#initialize ⇒ LaTeXFont
Returns a new instance of LaTeXFont.
323 324 325 |
# File 'lib/ctioga2/graphics/styles/texts.rb', line 323 def initialize # Nothing to be done end |
Instance Attribute Details
#font_command ⇒ Object
The font command (bf, sf…). Naive but effective !
321 322 323 |
# File 'lib/ctioga2/graphics/styles/texts.rb', line 321 def font_command @font_command end |
Class Method Details
.from_text(txt) ⇒ Object
327 328 329 330 331 332 |
# File 'lib/ctioga2/graphics/styles/texts.rb', line 327 def self.from_text(txt) # For now, only the naive way of things: font = self.new font.font_command = txt return font end |
Instance Method Details
#fontify(txt) ⇒ Object
Returns text wrapping txt with the appropriate functions to get the appropriate font in LaTeX.
336 337 338 339 340 341 |
# File 'lib/ctioga2/graphics/styles/texts.rb', line 336 def fontify(txt) if @font_command return "{\\#{@font_command} #{txt}}" end return txt end |