unicodeGraphics2.frink

Download or view unicodeGraphics2.frink in plain text format


// Program to draw and print all Unicode characters, 
// skipping those that are undefined or missing glyphs.
g = new graphics

fontname = "SansSerif"
g.font[fontname, 1]

pc = staticJava["java.awt.Font", "PLAIN"]
jf = newJava["java.awt.Font", [fontname, 10, pc]]

vis = new array

for u = 0 to 0x1FFFF
   if jf.canDisplay[u] and callJava["java.lang.Character", "isDefined", u]
      vis.push[u]

n = length[vis]
println["$n glyphs found."]

pagesWide = 1
pagesHigh = 6

// Find characters per row to support the specified spacing
w = int[sqrt[n * (8.5 / 11) * (pagesWide/pagesHigh)]]

s = 11/10    // Intercharacter spacing
for c = 0 to n-1
   g.text[char[vis@c], s (c mod w), s (c div w)]

g.show[]
g.printTiled[pagesWide, pagesHigh]


Download or view unicodeGraphics2.frink in plain text format


This is a program written in the programming language Frink.
For more information, view the Frink Documentation or see More Sample Frink Programs.

Alan Eliasen was born 20143 days, 9 hours, 54 minutes ago.