Skip to content

Commit 1135f47

Browse files
committed
list fonts
1 parent bebcd1c commit 1135f47

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

basics/typography/font_list.rb

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/usr/bin/env jruby
2+
# frozen_string_literal: true
3+
4+
require 'picrate'
5+
6+
# PiCrate Sketch
7+
class FontList < Processing::App
8+
9+
def settings
10+
size(200, 200)
11+
end
12+
13+
def setup
14+
# Uncomment the following two lines to see the available fonts
15+
Java::ProcessingCore::PFont.list.each { |fot| puts fot }
16+
my_font = create_font('Noto Sans', 32)
17+
text_font(my_font)
18+
text_align(CENTER, CENTER)
19+
text('!@#$%', width / 2, height / 2)
20+
end
21+
end
22+
23+
FontList.new

0 commit comments

Comments
 (0)