Skip to content

Commit

Permalink
Multi line text
Browse files Browse the repository at this point in the history
  • Loading branch information
emaillenin committed Jun 18, 2015
1 parent 5141e14 commit 8816d2b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/image_annotate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def apply_template
caption_text.annotate(@image_list,
@source_image.columns,
@source_image.rows,
@source_image.columns/2,
@source_image.columns/2 - 500,
text_offset * @source_image.rows, caption['text']) do
self.gravity = Magick::CenterGravity
self.pointsize = caption['size']
Expand All @@ -37,7 +37,7 @@ def apply_template
# self.rotation = 270
self.kerning = 1
self.interline_spacing = caption['line_spacing'] || 5
self.align = CenterAlign
self.align = LeftAlign
end
@image_list
end
Expand All @@ -46,6 +46,6 @@ def text_offset
if @caption['text'].to_s.count("\n") == 2
return 0.8
end
0.88
0.28
end
end
19 changes: 14 additions & 5 deletions template.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,34 @@

image:
path: "/Users/leninraj/Dropbox/Common/duggout-design/Background for Image Mojo/Sky 1 Trim.jpeg"

image_copyright:
file: logo-only-white.png
location: NorthEastGravity

hashtag:
text: india
text: stats
x_offset: 25
y_offset: 25
font: Roboto
color: white

aption_player:
text: "2nd ODI: Australia win\nby 4 wickets"
caption_player:
text: |
WHICH CAPTAIN HAS THE MOST MATCHES
IN ODI?
Ricky Ponting - 230 Matches
Stephen Fleming - 218 Matches
Arjuna Ranatunga - 193 Matches
Allan Border - 178 Matches
MS Dhoni - 178 Matches
line_spacing: 15
blur: 0.4
font: Serif
size: 45
color: white
quote: false
background: true
background: false
# background_color: rgba(150,93,14,0.9) # brown
# background_color: rgba(255,255,255,0.8) # white
background_color: rgba(10,10,10,0.9) # black
Expand Down

0 comments on commit 8816d2b

Please sign in to comment.