Does PDF renderer supports non-latin encodings?
in
Core Library Questions
•
2 years ago
When I use loadFont function, bitmap font file and default Processing rendering (in window), Cyrillic text is shown correctly.
When I switch to PDF mode which requires createFont instead, only latin characters are rendered.
Code sample:
- import processing.pdf.*;
- PFont cyrFont;
- void setup() {
- cyrFont = createFont("Tahoma", 14);
- size(300, 300, PDF, "cyr.pdf");
- textFont(cyrFont, 14);
- text("This is regular text", 50, 50);
- text("This isn't: «кириллица»", 50, 150);
- text("This isn't: «\u00f1\u0410»", 50, 250);
- exit();
- }
Result (u00f1 is «ñ», u0410 is Cyrillic letter «А»):
OS X 10.6.6, Java 1.6.0_24, Processing 1.2.1
1