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:
committed by
Andy Meneely
parent
06970b77a6
commit
f800c131ff
@@ -3,18 +3,18 @@ require 'squib'
|
||||
Squib::Deck.new(config: 'config_text_markup.yml') do
|
||||
background color: :white
|
||||
text str: %{"'Yaml ain't markup', he says"},
|
||||
x: 10, y: 10, width: 300, height: 200, font: 'Serif 20',
|
||||
x: 10, y: 10, width: 300, height: 200, font: 'Serif 7',
|
||||
markup: true, hint: :cyan
|
||||
|
||||
text str: 'Notice also the antialiasing method.',
|
||||
x: 320, y: 10, width: 300, height: 200, font: 'Arial Bold 20'
|
||||
x: 320, y: 10, width: 300, height: 200, font: 'Arial Bold 7'
|
||||
|
||||
save_png prefix: 'config_text_'
|
||||
end
|
||||
|
||||
Squib::Deck.new(config: 'config_disable_quotes.yml') do
|
||||
text str: %{This has typographic sugar --- and ``explicit'' quotes --- but the quotes are "dumb"},
|
||||
x: 10, y: 10, width: 300, height: 200, font: 'Serif 20',
|
||||
x: 10, y: 10, width: 300, height: 200, font: 'Serif 7',
|
||||
markup: true, hint: :cyan
|
||||
save_png prefix: 'config_disable_text_'
|
||||
end
|
||||
|
||||
@@ -6,7 +6,7 @@ Squib::Deck.new(config: 'custom-config.yml') do
|
||||
|
||||
# Hints can be turned on in the config file
|
||||
text str: 'The Title', x: 0, y: 78, width: 825,
|
||||
font: 'Arial 72', align: :center
|
||||
font: 'Arial 24', align: :center
|
||||
|
||||
# Progress bars are shown for these commands
|
||||
# And images are taken from img_dir, not the cwd.
|
||||
|
||||
Reference in New Issue
Block a user