I want to use Dillo2 to browse web, but I found dillo2 can't display Chinese
text properly. So I tried to test if FLTK2 can dispaly Chinese Text. I
adopted the hello world example from FLTK2 tutorial and insert some Chinese
and Japanese text after "Hello World!". All the Eastern Asia text are
displayed in empty blocks. Here is my code:
// hello.cxx (example1)
//compile with: c++ -o fltkhello fltkhello.cxx -I/usr/local/include
-L/usr/local/lib -lfltk2 -lXext -lXft -lX11 -lXi -lm
#include <fltk/Window.h>
#include <fltk/Widget.h>
#include <fltk/Font.h>
#include <fltk/run.h>
#include <stdio.h>
using namespace fltk;
int main(int argc, char **argv) {
/* Font ** arrayp;
int n = list_fonts(arrayp);
printf("Number of font items: %d\n", n);
*/
Window *window = new Window(700, 400);
window->begin();
Widget *box = new Widget(20, 40, 300, 200, "Hello, World!\n 中文測試 与えてその");
box->box(UP_BOX);
//box->labelfont(HELVETICA_BOLD_ITALIC);
fltk::Font *f = font("iLiHei", 1);
box->labelfont(f);
box->labelcolor(0xFF008000);
box->labelsize(36);
box->labeltype(SHADOW_LABEL);
window->end();
window->show(argc, argv);
return run();
}
I am using Debian 5, and I have proper truetype fonts installed. I also
read Erco's Japanese text example (
http://www.seriss.com/people/erco/fltk/utf8-japanese-songs.cxx), but it
seems a FLTK example, not FLTK2.
Please help if you have any idea about this problem. Thanx.
_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev