![]() When beetles battle beetles in a puddle paddle battle and the beetle battle puddle is a puddle in a bottle.they call this a tweetle beetle bottle puddle paddle battle muddle." Squib :: Deck. AND when tweetle beetles battle with paddles in a puddle, they call it a tweetle beetle puddle paddle battle. ![]() And when they battle in a puddle, it's a tweetle beetle puddle battle. When tweetle beetles fight, it's called a tweetle beetle battle. \n What do you know about tweetle beetles? well. # encoding: UTF-8 # require 'squib' require_relative '././lib/squib' data = longtext = "This is left-justified text, with newlines. Unit is in radians.' do | x, y | text str : 'Rotated', hint : :red, x : x, y : y, angle : Math :: PI / 6 end save_png prefix : '_text_' end with_index do | str, i | text_y = y i * 50 extents = text str : str, x : x, y : text_y, font : 'Sans Bold 8' # Extents come back as an array of hashes, which can get split out like this text_width = extents text_height = extents rect x : x, y : text_y, width : text_width, height : text_height, radius : 10, stroke_color : :purple, stroke_width : 3 end end sample 'Text can be rotated about the upper-left corner of the text box. So you can custom-fit a shape around it.' do | x, y |. It is autoscaled to the largest size that fits instead.', x : x - 50, y : y, hint : :red, width : 350, height : 100, ellipsize : :autoscale, font : 'Serif bold 7' end sample 'If you specify the width only, and turn off ellipsize, the height will auto-stretch.' do | x, y | text str : 'This has fixed width, but not fixed height.', x : x, y : y, hint : :red, width : 300, ellipsize : false, font : 'Serif bold 8' end sample 'The text method returns the ink extents of each card\'s rendered text. Also: set "hint" to see the extents of your text box' do | x, y | text str : 'This has fixed width and height.', x : x, y : y, hint : :red, width : 300, height : 100, font : 'Serif bold 8' end sample 'If you specify the width only, the text will ellipsize.' do | x, y | text str : 'The meaning of life is 42', x : x - 50, y : y, hint : :red, width : 350, font : 'Serif bold 7' end sample 'If you specify ellipsize: :autosize, the font size will autoscale.' do | x, y | text str : 'This text doeas not fit with font size 7. Font names with spaces in them should end with a comma to help with parsing.' do | x, y | text font : 'Arial bold italic 11', str : 'Bold and italic!', x : x, y : y - 50 text font : 'Arial weight=300 11', str : 'Light bold!', x : x, y : y text font : 'Times New Roman, 11', str : 'Times New Roman', x : x, y : y 50 text font : 'NoSuchFont,Arial 11', str : 'Arial Backup', x : x, y : y 100 end sample 'Specify width and height to see a text box. new ( width : 1000, height : 1450 ) do draw_graph_paper width, height sample 'Font strings are quite expressive. Require 'squib' require 'squib/sample_helpers' Squib :: Deck.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |