GIDForums  

Go Back   GIDForums > Computer Programming Forums > FLTK Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 13-Jul-2005, 19:27
minifang minifang is offline
New Member
 
Join Date: Jun 2005
Posts: 13
minifang is on a distinguished road

how to display chinese?


I need display chinese in my program
I Load chinese font face(simsun(gb2312-1980))
but the string dispeared
can you tell me what happened?
and what I should do if I want get chinese?

thank you very much!
  #2  
Old 17-Jul-2005, 03:51
minifang minifang is offline
New Member
 
Join Date: Jun 2005
Posts: 13
minifang is on a distinguished road
Does someone meet the same question?
  #3  
Old 17-Jul-2005, 07:19
cable_guy_67's Avatar
cable_guy_67 cable_guy_67 is offline
Senior Member
 
Join Date: Oct 2004
Location: Nescopeck, PA
Posts: 1,109
cable_guy_67 is a jewel in the roughcable_guy_67 is a jewel in the roughcable_guy_67 is a jewel in the roughcable_guy_67 is a jewel in the rough
I thought that was you on the fltk newsgroups. The same question was posed there.

Quote:
Originally Posted by fltk.org general
> the code is test/fonts.cxx
> the simsun(gb2312-1980) is DBCS
> I think the fltk can't recognize DBCS
> is it?

You are correct, FLTK 1.1.x does not work with anything but single byte characters. There is a patched version that does support UTF-8, if that would be helpful for you: www.oksid.ch/fltk-utf/

So it appears that font will not work with 1.1.x. IIRC this was going to be addressed for 2.0. I can't say anything for the patched version the link will take you to. Perhaps it would be worth the hassle.

Mark
__________________
"Opportunity is missed by most people because it comes dressed in overalls and looks like work."
--Thomas Alva Edison
"Those who would give up essential liberty to purchase a little temporary safety, deserve neither liberty nor safety."
--Benjamin Franklin
"A happy person is not a person in a certain set of circumstances, but rather a person with a certain set of attitudes."
--Hugh Downs
  #4  
Old 19-Jul-2005, 20:24
minifang minifang is offline
New Member
 
Join Date: Jun 2005
Posts: 13
minifang is on a distinguished road
Quote:
Originally Posted by cable_guy_67
I thought that was you on the fltk newsgroups. The same question was posed there.



So it appears that font will not work with 1.1.x. IIRC this was going to be addressed for 2.0. I can't say anything for the patched version the link will take you to. Perhaps it would be worth the hassle.

Mark

you say 1.1.x didn't surpport chinese. and 2.0 will ?
I download the fltk-utf8 patch,but it also can't work.
if the problem can't be solved,I must choose another GUI
I have study it for a long time. I don't want to give up it!

??:
  #5  
Old 19-Jul-2005, 21:18
cable_guy_67's Avatar
cable_guy_67 cable_guy_67 is offline
Senior Member
 
Join Date: Oct 2004
Location: Nescopeck, PA
Posts: 1,109
cable_guy_67 is a jewel in the roughcable_guy_67 is a jewel in the roughcable_guy_67 is a jewel in the roughcable_guy_67 is a jewel in the rough
Quote:
Originally Posted by minifang
you say 1.1.x didn't surpport chinese. and 2.0 will ?

Part of the problem I have is that I use the standard fonts and unless a program installs its own special font I never mess with them. Maybe you can teach me a thing or two here. What exactly is utf8 for and how does it relate with the fonts? Are there fonts you can use (to display chinese characters) that are not of this extended type? You are correct, 1.1.x does not have utf8 support and 2.0 is supposed to have it.

Like I said, I just don't know the answers so if you could shed some light on it for me perhaps I could be more helpful.

Quote:
Originally Posted by minifang
I download the fltk-utf8 patch,but it also can't work.
What was the problem? Were you not able to get fltk to build? I looked at the site quickly after seeing the link at fltk.org. When I get some time I'll take a closer look and see if I can't help you out there. I have a hard time sitting at the keyboard after a long workdays in the heat though.

Quote:
Originally Posted by minifang
if the problem can't be solved,I must choose another GUI
I have study it for a long time. I don't want to give up it!

Yikes! That sounds really bad. Don't give up just yet. The only thing I have found to be a headache with fltk is the amount of time it takes to go from being able to put together a decent UI, to the time it takes to have a good handle on how fltk does things. The library is large enough that you have no choice but to crawl in and learn what seems to be a c++ dialect. I would hate to see you have to throw that time away. Are you using 1.1.x for any reason other than the stability of it? You could always shift over to 2.0 unless but it really is not as stable and will be undergoing large changes for the next few years most likely. It seems to be designed to be The FLTK at some point. Many of the good solid 1.1.x ideas and working code is being moved to 2.0 code in the library itself. That tells me everything you like about 1.1.x will eventually be part of 2.0. Just not today.

I guess I will have to do a little reading on utf8 and how it would relate to a chinese font.

Good Luck, sorry I can't be more helpful just yet.

Mark
__________________
"Opportunity is missed by most people because it comes dressed in overalls and looks like work."
--Thomas Alva Edison
"Those who would give up essential liberty to purchase a little temporary safety, deserve neither liberty nor safety."
--Benjamin Franklin
"A happy person is not a person in a certain set of circumstances, but rather a person with a certain set of attitudes."
--Hugh Downs
  #6  
Old 20-Jul-2005, 02:15
minifang minifang is offline
New Member
 
Join Date: Jun 2005
Posts: 13
minifang is on a distinguished road
Quote:
Originally Posted by cable_guy_67
Part of the problem I have is that I use the standard fonts and unless a program installs its own special font I never mess with them. Maybe you can teach me a thing or two here. What exactly is utf8 for and how does it relate with the fonts? Are there fonts you can use (to display chinese characters) that are not of this extended type? You are correct, 1.1.x does not have utf8 support and 2.0 is supposed to have it.

Like I said, I just don't know the answers so if you could shed some light on it for me perhaps I could be more helpful.


What was the problem? Were you not able to get fltk to build? I looked at the site quickly after seeing the link at fltk.org. When I get some time I'll take a closer look and see if I can't help you out there. I have a hard time sitting at the keyboard after a long workdays in the heat though. Mark

I had installed the fltk-utf8, but it also can't show chinese characters.
when intall it ,I get some warning like:
lcUniConv/big5.h:4103: warning: `big5_wctomb' defined but not used
lcUniConv/gb2312.h:2518: warning: `gb2312_wctomb' defined but not used
lcUniConv/jisx0201.h:30: warning: `jisx0201_wctomb' defined but not used
lcUniConv/jisx0208.h:2360: warning: `jisx0208_wctomb' defined but not used
lcUniConv/jisx0212.h:2135: warning: `jisx0212_wctomb' defined but not used
lcUniConv/ksc5601.h:2966: warning: `ksc5601_wctomb' defined but not used

You are so kindly. Thank you very much.
I graduate form university last year. And now I am in a IT company.
I like programming. But somtimes I have no enough confidence to work well

谢谢!
  #7  
Old 20-Nov-2005, 11:03
oksid oksid is offline
New Member
 
Join Date: Nov 2005
Posts: 6
oksid is on a distinguished road

Re: how to display chinese?


Quote:
Originally Posted by minifang
I had installed the fltk-utf8, but it also can't show chinese characters.

FLTK-UTF8 can display chinese.
But you must use UTF-8 encoded text and set the good font.
see the test program test/utf8.cxx
  #8  
Old 20-Nov-2005, 22:53
minifang minifang is offline
New Member
 
Join Date: Jun 2005
Posts: 13
minifang is on a distinguished road

Re: how to display chinese?


Quote:
Originally Posted by oksid
FLTK-UTF8 can display chinese.
But you must use UTF-8 encoded text and set the good font.
see the test program test/utf8.cxx

Yes,it can display chinese.Thank you very much!

And I have another question.How to open XIM?
This is my program:
CPP / C++ / C Code:
#include<FL/Fl.H>
#include<FL/Fl_Window.H>
#include<stdio.h>
#include<X11/Xlib.h>
#include<X11/Xlocale.h>

 int main(int argc, char ** argv)
{
   Display *display;
   XIM fl_xim=NULL;
   if(XOpenIM(display,NULL,NULL,NULL)==NULL)
       printf("XIM Open failed\n");

       Fl_Window *window = new Fl_Window(500,500,"test");
       Fl_Button *button = new Fl_Button(300,30,250,30);
       new Fl_Button(300,100,50,30,"abc");

   window->end();
   window->show(argc,argv);
   return Fl::run();
}

The program should show "XIM open failed",because I didn't open XIM on X-Widnow.But it didn't show "XIM open failed".
Last edited by cable_guy_67 : 08-Jul-2006 at 05:18. Reason: added [c++] codetag
  #9  
Old 21-Nov-2005, 10:59
oksid oksid is offline
New Member
 
Join Date: Nov 2005
Posts: 6
oksid is on a distinguished road

Re: how to display chinese?


Quote:
Originally Posted by minifang
How to open XIM?

You don't need to do anything.
All the XIM things are handled by FLTK-UTF8.

You just need to start your XIM server and set the environmental variables in your shell.
(i.e . : export LANG=zh_TW; export XMODIFIERS="@im=xcin-zh_CN")
Then start your FLTK-UTF8 program.

If you want to know how I've made it, you can take a look at src/Fl_x.cxx
  #10  
Old 21-Nov-2005, 19:20
minifang minifang is offline
New Member
 
Join Date: Jun 2005
Posts: 13
minifang is on a distinguished road

Re: how to display chinese?


Quote:
Originally Posted by oksid
You don't need to do anything.
All the XIM things are handled by FLTK-UTF8.

You just need to start your XIM server and set the environmental variables in your shell.
(i.e . : export LANG=zh_TW; export XMODIFIERS="@im=xcin-zh_CN")
Then start your FLTK-UTF8 program.
why it is very slowly?
when I run my program with chinese ,the window display first, then the chinese character display.If the font is biger,it will take more time to display.
Quote:
Originally Posted by oksid
If you want to know how I've made it, you can take a look at src/Fl_x.cxx
I have take a look at src/Fl_x.cxx.
I want open XIM in my program , I Only need the function XOPenIM()?

Thank you very much!!
 
 

Recent GIDBlogToyota - 2008 November Promotion by Nihal

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
dial display maverick FLTK Forum 5 04-Jul-2005 16:46
problems with a text display in a tab maveganzones FLTK Forum 2 23-Mar-2005 03:26
How do I display <filename>.bmp on the screen? oriharel MS Visual C++ / MFC Forum 1 01-Dec-2004 15:51
uisng php to display php dopee MySQL / PHP Forum 6 14-May-2004 19:40

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 05:35.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.