lib/wiz_rtf/text.rb in wiz_rtf-0.6.8 vs lib/wiz_rtf/text.rb in wiz_rtf-0.6.9
- old
+ new
@@ -26,20 +26,20 @@
#
# WizRtf::Text.new("A Example of Rtf Document", 'text-align' => :center, 'font-family' => 'Microsoft YaHei', 'font-size' => 48, 'font-bold' => true, 'font-italic' => true, 'font-underline' => true)
#
def initialize(str = '', styles = {})
@str = str
- @styles = {'text-align' => :left, 'font-family' => 0, 'font-size' => 24, 'font-bold' => false, 'font-italic' => false, 'font-underline' => false, 'foreground-color' => 0, 'background-color' => 0 }.merge(styles)
+ @styles = {'text-align' => :left, 'font-family' => 0, 'font-size' => 12, 'font-bold' => false, 'font-italic' => false, 'font-underline' => false, 'foreground-color' => 0, 'background-color' => 0 }.merge(styles)
end
# Outputs the Partial Rtf Document to a Generic Stream as a Rich Text Format (RTF).
# * +io+ - The Generic IO to Output the RTF Document.
def render(io)
io.group do
io.cmd :pard
io.cmd TEXT_ALIGN_MAP[@styles['text-align']]
io.cmd :f, @styles['font-family']
- io.cmd :fs, @styles['font-size']
+ io.cmd :fs, @styles['font-size'] * 2
io.cmd @styles['font-bold'] ? 'b' : 'b0'
io.cmd @styles['font-italic'] ? 'i' : 'i0'
io.cmd @styles['font-underline'] ? 'ul' : 'ulnone'
io.cmd :cf, @styles['foreground-color']
io.cmd :cb, @styles['background-color']