trebari wrote on Feb 26th, 2009, 11:46am:I don't know what to do next...
Well, as I wrote, trying to generate the full Unicode range can be demanding... As I shown, use createFont, but indicate it to include Korean characters. These are Hangul chars, right
Searching... Right.
The interesting page
Korean Unicode Fonts shows lot of fonts supporting this set. It also points to the useful
CJK FAQ. Looks like we need Jamo too (I don't know Korean language, alas). Or not, Hangul is perhaps enough.
Anyway, let's do an example: using the good BabelMap utility, I see that Hangul Syllables start at 0xAC00 and ends... at 0xD7A3. Wow, lot of characters!
Anyway, reusing my previous sketch, I did:
Code:size(800, 200, P2D); // Must be first!
char[] charset = new char[0xD7A3 - 0xAC00 + 1];
StringBuilder strB = new StringBuilder();
for (int i = 0, code = 0xAC00; code <= 0xD7A3; i++, code++)
{
charset[i] = Character.toChars(code)[0];
if (i % 256 == 0)
{
strB.append(charset[i]);
}
}
println("Creating font");
PFont myFont = createFont("Arial Unicode MS", 24, true, charset);
background(0);
fill(255);
textFont(myFont);
text(strB.toString(), 10, 100);
My old computer creates the font subset without problem although that's a bit slow.
Maybe a possible improvement to the create font dialog would be to indicate subsets. Or Processing should allow saving the font after calling createFont, would be even more flexible (although rarely used, I fear).