Browse Source

Initial commit

master
The Stranjer 4 years ago
commit
dc35bce657
16 changed files with 104 additions and 0 deletions
  1. BIN
      VTCGoblinHand.ttf
  2. BIN
      VTCGoblinHandBold.ttf
  3. BIN
      VTCGoblinHandItalic.ttf
  4. BIN
      VTCGoblinHandSC.ttf
  5. BIN
      abess.ttf
  6. BIN
      compmalf.ttf
  7. BIN
      cover.png
  8. BIN
      cover.xcf
  9. BIN
      goudy-bold.ttf
  10. BIN
      goudy-italic.ttf
  11. BIN
      goudy.ttf
  12. BIN
      lilith.ttf
  13. BIN
      ultramarines.ttf
  14. BIN
      unispace rg.ttf
  15. BIN
      writeup.pdf
  16. +104
    -0
      writeup.rb

BIN
VTCGoblinHand.ttf View File


BIN
VTCGoblinHandBold.ttf View File


BIN
VTCGoblinHandItalic.ttf View File


BIN
VTCGoblinHandSC.ttf View File


BIN
abess.ttf View File


BIN
compmalf.ttf View File


BIN
cover.png View File

Before After
Width: 612  |  Height: 792  |  Size: 762KB

BIN
cover.xcf View File


BIN
goudy-bold.ttf View File


BIN
goudy-italic.ttf View File


BIN
goudy.ttf View File


BIN
lilith.ttf View File


BIN
ultramarines.ttf View File


BIN
unispace rg.ttf View File


BIN
writeup.pdf View File


+ 104
- 0
writeup.rb View File

@@ -0,0 +1,104 @@
require "prawn"
require "prawn/table"
require "pry"

class Prawn::Document
def background_color(color)
tmp_color = fill_color
canvas do
fill_color color
fill_rectangle [bounds.left, bounds.top], bounds.right, bounds.top
end
fill_color tmp_color
end
end

class Awakened2069
FONT_SIZE_CHAPTER = 48
FONT_SIZE_BODY = 10

attr_accessor :pdf, :chapter_title

def start_chapter(chapter_name)
@chapter_title = chapter_name
puts "Starting #{chapter_title}"

pdf.start_new_page

pdf.outline.update do
puts "\tAdding #{@awakened2069.chapter_title} on page #{page_number}"
section(@chapter_title, :destination => page_number)
end

puts "\tSetting font size"
pdf.font_size Awakened2069::FONT_SIZE_CHAPTER
pdf.font "Abess"
puts "\tPrinting chapter to document"
pdf.text chapter_title, :align => :center

puts "\tRestoring body text"
pdf.font "Goudy"
pdf.font_size FONT_SIZE_BODY
end


def generate
@pdf = Prawn::Document.new(:margin => 0)
pdf.font_families.update(
"Goudy" => {
:normal => "goudy.ttf",
:bold => "goudy-bold.ttf",
:italic => "goudy-italic.ttf"
},
"Abess" => {
:normal => "abess.ttf"
},
"Lilith" => {
:normal => "lilith.ttf"
},
"Goblin Hand" => {
:normal => "VTCGoblinHand.ttf",
:bold => "VTCGoblinHandBold.ttf",
:italic => "VTCGoblinHandItalic.ttf"
},
"Ultramarines" => {
:normal => "ultramarines.ttf"
},
"Unispace" => {
:normal => "unispace rg.ttf"
}
)

pdf.outline.instance_variable_set(:@awakened2069, self)

pdf.image("cover.png", :width => 612, :height => 792)

pdf.start_new_page(:margin => 50)

pdf.font "Ultramarines"
pdf.font_size 72
pdf.text "Awakened 2069", :align => :center

pdf.font "Goudy"
pdf.font_size 36
pdf.text "\nGuide To The Mage: the Awakening, Second Edition Game On Discord. \n\nInvite Code:", :align => :center

pdf.font "Unispace"
pdf.text "25MpfjP", :align => :center

pdf.font "Goudy"

pdf.font_size 24
pdf.text "\n\nAll content in this manual is inspired by the Storyteller and the players", :align => :center

start_chapter "Introduction"



pdf.render_file("writeup.pdf")
end
end


awakened2069 = Awakened2069.new
awakened2069.generate

Loading…
Cancel
Save