> ian wrote:
>> In case anyone is still following this, here:
>> http://www.imm.uklinux.net/fltk/fltk118-utf8-2007-07-14.tar.bz2
>> is another snapshot.

        With --enable-xft, I was able to build ok on fedora3,
        but I can't seem to get my old fltk-utf8-1.1.6-3 japanese utf8 test
        program to show japanese text under fltk118-utf8.

        The following worked under the older fltk-utf8-1.1.6-3, where
        it would show 5 characters of japanese text in the box
        that looks something like, urm, the following ascii art:

                 #              #
    #             #            #     ######    #     ##
   #########   #  # ##        #   #             #####
  #       #     ####             # #########       #
 # # #### #    #  #       #     ##      #         # #####
   # #  # #   #######     ##   # #      #        ###     #
   # #### #       #        #     #      #       #        #
   # #  # #       #        #     #      #          #### #     ###
   #      #        ##     ##     #      #         #    #      # #
   #     ##          #####       #    ###          ####       ###


        (hope you're reading this in a fixed font size)

        Not sure if this is a problem with my fonts, or an
        incompatibility between XFT fonts and regular X fonts.

        Only tried this under linux, and gave up after many attempts
        changing around the font names, and switching back and forth
        between compiling the app between the new 1.1.8 and the old 1.1.6
        utf8 versions of fltk.

        Will try windows next.

        Here's the app I've been using for testing in the past.
        If you run the app from a terminal that will show utf8,
        the printf() should show the same characters.

        For instance, I was able to do this from within gvim
        with ':set encoding=utf8' enabled, and running the app with :!./foo

        Also, I could run it from gnome-terminal, assuming I first
        'enabled' utf8 mode by running:

                echo '\033%G'

        ..which magically enables utf8 viewing in gnome-terminal.


#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Box.H>
#include <stdlib.h>
#include <stdio.h>

int main(int argc, char **argv)
{
  Fl_Window *window = new Fl_Window(300,180);

#ifdef MICROSOFT
  // MICROSOFT: JAPANESE UTF8
  Fl::set_font(FL_HELVETICA, "MS Gothic");
#else
  // LINUX: JAPANESE UTF8
  Fl::set_font(FL_HELVETICA,
      "-*-mincho-medium-r-*-*-*-*-*-*-*-*-jisx0208.1983-*,"     // nice for 
large fonts
      "-*-gothic-medium-r-normal--*-*-*-*-*-*-jisx0208.1983-*," // nice on 9.0
      "-*-fixed-*-*-*--*-*-*-*-*-*-jisx0208.1983-*,"            // needed for 
7.3
  );
#endif

  // SOME JAPANESE UTF8 TEXT
  char *utfstr = "\xe4\xbd\x95\xe3\x82\x82\xe8\xa1"
                 "\x8c\xe3\x82\x8b\xe3\x80\x82";
  printf("UTF8=<%s>\n", utfstr);                // tests if terminal will show 
utf8 japanese
  Fl_Box *box = new Fl_Box(FL_UP_BOX,20,40,260,100,utfstr);
  box->labelsize(36);
  window->end();

  window->show(argc, argv);
  return Fl::run();
}
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to