Created
February 5, 2009 18:17
-
-
Save bradediger/58890 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'prawn' | |
CHECKBOX = "\xE2\x98\x90" # "☐" | |
FILLED_CHECKBOX = "\xE2\x98\x91" # "☑" | |
Prawn::Document.generate("checkbox_test.pdf") do | |
# Use a font with the checkbox characters: | |
# http://www.fileformat.info/info/unicode/char/2610/fontsupport.htm | |
font "fonts/dejavu/ttf/DejaVuSans.ttf" | |
text "#{CHECKBOX} Not done yet" | |
text "#{FILLED_CHECKBOX} Complete!" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Also, you can use
formatted_text
so the label is in your default font: