Jump to content

  • Log In with Google      Sign In   
  • Create Account

We need your feedback on a survey! Each completed response supports our community and gives you a chance to win a $25 Amazon gift card!


Chinese character in OpenGL


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
10 replies to this topic

#1 Kenny Ho   Members   -  Reputation: 122

Like
Likes
Like

Posted 08 September 2001 - 11:38 PM

Hello, I''m newbie in OpenGL. How can I display a chinese character in OpenGL? Could anyone give me a example please? Thank you .

Sponsor:

#2 Dean Harding   Members   -  Reputation: 546

Like
Likes
Like

Posted 09 September 2001 - 12:03 AM

Chinese characters are difficult, simply because there''s so many of them. Now, I''m no linguist, and I don''t know any chinese, so my assumptions about the characters may be wrong, but the way I do it is to have a "character cache". Say you store the last 100 characters drawn in some cache, and whenever you go to draw a new one, you check if it''s in the cache and just use that, if not, you flush one of the old characters and draw this one in (perhaps using GDI, or your own rendering function, or maybe even loading the glyph from disk). It''s not lightning fast, but I don''t think you''re going to find any lightning fast methods (that don''t use enormous amounts of memory).

This would work well if you have a few commonly used characters and the rest are only used now and then (even better if they''re usually used more than once in any given sentence/phrase).

Like I said, I don''t know Chinese, so I don''t know if those are valid assumptions.

If you''re new to OpenGL, though, I would recommend you forget about Chinese characters and just use English characters (or some other language where the actual management of the glyphs is not a concern). Come back to the problem when you know a bit more.


codeka.com - Just click it.

#3 Maximus   Members   -  Reputation: 124

Like
Likes
Like

Posted 09 September 2001 - 12:18 AM

Create a character map in your favourite graphics program, with all the characters using an equal amount of space. Load it into opengl, and when writing the text out to the screen, bind to the character map texture, and set the texture coordinates to the character you wish to display.

#4 Dean Harding   Members   -  Reputation: 546

Like
Likes
Like

Posted 09 September 2001 - 11:29 AM

Maximus, you do realise that there''s around 14,000 chinese characters, don''t you?


codeka.com - Just click it.

#5 jtech   Members   -  Reputation: 108

Like
Likes
Like

Posted 10 September 2001 - 09:54 AM

That would be something cool.

I don''t think he wants to draw them BY HAND.

Isn''t there some way to display foreign True Type characters in Windows
using GDI? If there is, just use GDI to draw them on a bitmap and display
them.

But you did not specify if you wanted 2D or 3D extruded text. I think there
is a way to do both.

#6 SirKnight   Members   -  Reputation: 316

Like
Likes
Like

Posted 10 September 2001 - 10:25 AM

14,000 characters. Their keyboards must be big.

-SirKnight

#7 Lang Fox   Members   -  Reputation: 122

Like
Likes
Like

Posted 10 September 2001 - 10:54 PM

No,they use Microsoft keyboard also.But they have many way to input Chinese character.

#8 Maximus   Members   -  Reputation: 124

Like
Likes
Like

Posted 12 September 2001 - 12:01 AM

quote:
Original post by Dean Harding
Maximus, you do realise that there''s around 14,000 chinese characters, don''t you?


codeka.com - Just click it.


You''re point being? If he is determined enough to do it, then he will do it. If it isnt too important or he isnt determined enough, he wont do it.

It just means that it will be one hell of a big character map.

And to answer your question, no. I dont speak chinese, only english, a little indoneasian, and very little japanese.

#9 xiangping   Members   -  Reputation: 122

Like
Likes
Like

Posted 17 September 2001 - 04:06 AM

You can use wglUseFontOutlines function to create display lists and then use glCallLists to render the chinese words.
You can search the MSDN for a text3d screensaver sample code,I myself referenced this code
If you still can''t figure out how to do that,please feel free to contact me at xiangping@263.net,i''ll show you my code to handle that if you like.

#10 CodeSmith   Members   -  Reputation: 122

Like
Likes
Like

Posted 17 September 2001 - 04:23 AM

*this is just flames and ranting, please ignore*
O my God are you guys ignorant... Frankly I really don''t even understand why I goto this website when the average IQ around here is room temperature... Although someone actually had a *gasp* good Idea of using the windows built in ''3D text'' charachters, 1.) It wouldn''t be support for full manderin chinese and 2.) Your talking about literally eating memory.

The obvious solution is to simply have a 32-bit texture (One containing the alpha channel) of the word roots, as well as phenitic hints. Then (although by hand) you could construct your various kanji from those radicals w/o the need to store a seperate graphic. Such as ''rest'' being composed ''man'' and ''tree'', simply have the two textures, then render them side by side with the alpha test enabled.

I am very dissapointed in the ''l33t''

CodeSmith the Pixel Pusher
www.cs.trinity.edu/~csmith8

#11 jtech   Members   -  Reputation: 108

Like
Likes
Like

Posted 17 September 2001 - 10:22 AM

quote:

O my God are you guys ignorant...



Haha...look who''s talking.

Can''t anyone even read his post?

quote:

How can I display a chinese character in OpenGL? Could anyone give me a example please?



>>a chinese character<<, not 14,000, not japanese kanji characters, just
ONE CHINESE CHARACTER.

Just tell him how to do it if you know. No need to complicate things.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS