class CTioga2::Graphics::Styles::LaTeXFont
A LaTeX font. It should be applied to text using the function fontify
.
todo add real font attributes (family, and so on…)
@todo Deprecate in favor of the latter class
Attributes
font_command[RW]
The font command (bf, sf…). Naive but effective !
Public Class Methods
from_text(txt)
click to toggle source
# File lib/ctioga2/graphics/styles/texts.rb, line 330 def self.from_text(txt) # For now, only the naive way of things: font = self.new font.font_command = txt return font end
new()
click to toggle source
# File lib/ctioga2/graphics/styles/texts.rb, line 326 def initialize # Nothing to be done end
Public Instance Methods
fontify(txt)
click to toggle source
Returns text wrapping txt with the appropriate functions to get the appropriate font in LaTeX.
# File lib/ctioga2/graphics/styles/texts.rb, line 339 def fontify(txt) if @font_command return "{\\#{@font_command} #{txt}}" end return txt end