Respect DPI settings in text, add pt unit

This has the compatibility impact that all font sizes should be divided by 3 to maintain their same sizes.

Based on PR #225. Thanks @felixleong!!

Conflicts:
	bin/squib
	lib/squib/graphics/text.rb
This commit is contained in:
Seh Hui, Leong
2017-10-05 16:37:46 -04:00
committed by Andy Meneely
parent 06970b77a6
commit f800c131ff
43 changed files with 144 additions and 111 deletions
+1 -1
View File
@@ -4,7 +4,7 @@ Squib::Deck.new(cards: 8, layout: 'playing-card.yml') do
background color: :cyan
rect x: 37, y: 37, width: 750, height: 1050, fill_color: :black, radius: 25
rect x: 75, y: 75, width: 675, height: 975, fill_color: :white, radius: 20
text str: ('A'..'Z').to_a, layout: :bonus_ul, font: 'Sans bold 100'
text str: ('A'..'Z').to_a, layout: :bonus_ul, font: 'Sans bold 33'
# Defaults are sensible
hand # saves to _output/hand.png
+1 -1
View File
@@ -7,7 +7,7 @@ Squib::Deck.new(width: 825, height: 1125, cards: 16) do
rect x: 38, y: 38, width: 750, height: 1050,
x_radius: 38, y_radius: 38, stroke: 3.0, dash: '4 4'
text str: (1..16).to_a, x: 220, y: 78, font: 'Arial 54'
text str: (1..16).to_a, x: 220, y: 78, font: 'Arial 18'
# Here's what a regular save_png looks like for just the first card
save_png range: 0, prefix: 'save_png_'
+1 -1
View File
@@ -7,7 +7,7 @@ Squib::Deck.new(cards: 4) do
rect fill_color: '#DED4B9', x: 78, y: 78,
width: '2.25in', height: '3.25in', radius: 32
text str: %w(Grifter Thief Thug Kingpin),
font: 'Helvetica,Sans weight=800 120',
font: 'Helvetica,Sans weight=800 40',
x: 78, y: 78, width: '2.25in', align: :center
svg file: 'spanner.svg', x: (825 - 500) / 2, y: 500, width: 500, height: 500