Formatting updates

这个提交包含在:
The Stranjer 2019-05-27 15:20:48 -04:00
父节点 6c7bb2ff2e
当前提交 e1ce011557
共有 2 个文件被更改,包括 16 次插入16 次删除

查看文件

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

查看文件

@ -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(