|
|
@@ -10,7 +10,7 @@ class BookOfFaces |
|
|
|
FONT_SIZE_CHAPTER = 48 |
|
|
|
FONT_SIZE_SECTION = 24 |
|
|
|
FONT_SIZE_SUBSECTION = 18 |
|
|
|
FONT_SIZE_BODY = 12 |
|
|
|
FONT_SIZE_BODY = 10 |
|
|
|
|
|
|
|
attr_accessor :pdf, :number_name, :chapter_name, :chapter_title, :section_name, :spells |
|
|
|
|
|
|
@@ -40,7 +40,7 @@ class BookOfFaces |
|
|
|
end |
|
|
|
|
|
|
|
def start_section(section_name) |
|
|
|
puts "Beginning section #{section_name}:" |
|
|
|
puts "Beginning section #{section_name}: " |
|
|
|
|
|
|
|
@section_name = section_name |
|
|
|
|
|
|
@@ -91,7 +91,7 @@ class BookOfFaces |
|
|
|
|
|
|
|
puts "Creating PDF object..." |
|
|
|
@pdf = Prawn::Document.new(:margin => 0) |
|
|
|
pdf.default_leading 10 |
|
|
|
pdf.default_leading 5 |
|
|
|
|
|
|
|
pdf.font_families.update( |
|
|
|
"Goudy" => { |
|
|
@@ -167,60 +167,61 @@ class BookOfFaces |
|
|
|
@pdf.outline.section rating_title, :destination => @pdf.page_number |
|
|
|
end |
|
|
|
|
|
|
|
pdf.font_size FONT_SIZE_SUBSECTION |
|
|
|
pdf.font_size FONT_SIZE_SECTION |
|
|
|
pdf.text rating_title |
|
|
|
|
|
|
|
rating_spells.sort_by { |spell| spell.name }.each do |spell| |
|
|
|
puts "\t\tCompiling #{spell.full_title} by #{spell.authors.join(', ')}" |
|
|
|
|
|
|
|
spell_ary = [{:text => "#{spell.name} (", :font => "Lilith", :color => "004E6D", :size => FONT_SIZE_SECTION}] |
|
|
|
spell_ary = [{:text => "#{spell.name} (", :font => "Lilith", :color => "004E6D", :size => FONT_SIZE_SUBSECTION}] |
|
|
|
|
|
|
|
pdf.font_size FONT_SIZE_BODY |
|
|
|
spell.arcana.each do |arcanum| |
|
|
|
spell_ary << {:text => arcanum.to_s.titleize, :font => "Lilith", :color => "004E6D", :size => FONT_SIZE_SECTION} |
|
|
|
spell_ary << {:text => spell.send(arcanum).to_dots, :font => "Goudy", :color => "004E6D", :size => FONT_SIZE_SECTION} |
|
|
|
spell_ary << {:text => arcanum.to_s.titleize, :font => "Lilith", :color => "004E6D", :size => FONT_SIZE_SUBSECTION} |
|
|
|
spell_ary << {:text => spell.send(arcanum).to_dots, :font => "Goudy", :color => "004E6D", :size => FONT_SIZE_SUBSECTION} |
|
|
|
end |
|
|
|
|
|
|
|
spell_ary << {:text => ")", :font => "Lilith", :color => "004E6D", :size => FONT_SIZE_SECTION} |
|
|
|
spell_ary << {:text => ")", :font => "Lilith", :color => "004E6D", :size => FONT_SIZE_SUBSECTION} |
|
|
|
|
|
|
|
pdf.formatted_text spell_ary |
|
|
|
|
|
|
|
pdf.formatted_text [ |
|
|
|
{:text => "Practice:", :styles => [:bold], :font => "Goudy"}, |
|
|
|
{:text => "Practice: ", :styles => [:bold], :font => "Goudy"}, |
|
|
|
{:text => spell.practice, :font => "Goudy"}, |
|
|
|
] |
|
|
|
|
|
|
|
pdf.formatted_text [ |
|
|
|
{:text => "Primary Factor:", :styles => [:bold], :font => "Goudy"}, |
|
|
|
{:text => "Primary Factor: ", :styles => [:bold], :font => "Goudy"}, |
|
|
|
{:text => spell.primary_factor, :font => "Goudy"}, |
|
|
|
] |
|
|
|
|
|
|
|
pdf.formatted_text [ |
|
|
|
{:text => "Withstand:", :styles => [:bold], :font => "Goudy"}, |
|
|
|
{:text => "Withstand: ", :styles => [:bold], :font => "Goudy"}, |
|
|
|
{:text => spell.withstand, :font => "Goudy"}, |
|
|
|
] if !spell.withstand.nil? |
|
|
|
|
|
|
|
pdf.formatted_text [ |
|
|
|
{:text => "Suggested Rote Skills:", :styles => [:bold], :font => "Goudy"}, |
|
|
|
{:text => "Suggested Rote Skills: ", :styles => [:bold], :font => "Goudy"}, |
|
|
|
{:text => spell.suggested_rote_skills.join(', '), :font => "Goudy"}, |
|
|
|
] |
|
|
|
|
|
|
|
pdf.formatted_text [ |
|
|
|
{:text => spell.authors.length == 1 ? "Author:" : "Authors:", :styles => [:bold], :font => "Goudy"}, |
|
|
|
{:text => spell.authors.length == 1 ? "Author: " : "Authors: ", :styles => [:bold], :font => "Goudy"}, |
|
|
|
{:text => spell.authors.join(', '), :font => "Goudy"}, |
|
|
|
] |
|
|
|
|
|
|
|
pdf.text spell.rules_text |
|
|
|
|
|
|
|
spell.reaches.each do |reach| |
|
|
|
puts reach.inspect |
|
|
|
pdf.formatted_text [ |
|
|
|
{:text => "+#{reach[0]} Reach:", :styles => [:bold], :font => "Goudy"}, |
|
|
|
{:text => "+#{reach[0]} Reach: ", :styles => [:bold], :font => "Goudy"}, |
|
|
|
{:text => reach[1], :font => "Goudy"}, |
|
|
|
] |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
pdf.start_new_page |
|
|
|
end |
|
|
|
|
|
|
|
pdf.render_file("book_of_faces.pdf") |
|
|
|