Browse Source

Formatting updates

master
The Stranjer 5 years ago
parent
commit
e1ce011557
2 changed files with 16 additions and 16 deletions
  1. +16
    -15
      book_of_faces.rb
  2. +0
    -1
      spells.rb

+ 16
- 15
book_of_faces.rb View File

@@ -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")


+ 0
- 1
spells.rb View File

@@ -15,7 +15,6 @@ class Spell
[1, "Marionette can hijack living supernatural creatures."],
[2, "The shaman takes over direct control over the muscles and nerves of a life form, forcing it to perform whatever physical tasks the Shaman desires for the Duration. If conscious, the subject is fully aware of the fact that their body is acting outside of their control. This may cause Dissonance if the subject is a Sleeper. The willworker cannot have the target perform Social or Mental tasks."]
]

)

spells << Spell.new(


Loading…
Cancel
Save