Do you know ...?

Hi, does anyone out there know how to draw Chinese Font on OpenGL window? Can anyone show me how to do it?

Thanks.

May I ask why you posted this again ?

(no, I don’t know how to draw chinese fonts )

OpenGL doesn’t really have any real font handling. Instead, what you do is draw your text to an offscreen bitmap, and upload that as a texture, which you then draw on a quad (in alpha test mode, typically). How to do this varies by OS, but it’s fairly simple on Windows (with CreateDIBSection()).

Generally the method described above (textured quads) is the way to go with fonts. However judging from your other post it seems you want the actual 3d geometry of the font outline.

Are you absolutely sure you need this? i.e. do you want to extrude the font to a 3d shape etc?

If so, then I dont have a clue about your chinese font problem, but you could get around it by hunting out an app that generates the necessary vertex data for the font and then load that in instead. This would also have the advantage of not relying on your destination platform having chinese fonts installed.

I think I remember seeing an app that does something like this in the downloads section of NeHe’s site, not the bitmapfontbuilder - I think it was a proper 3dfont generator.

Originally posted by harryx:
[b]Generally the method described above (textured quads) is the way to go with fonts. However judging from your other post it seems you want the actual 3d geometry of the font outline.

Are you absolutely sure you need this? i.e. do you want to extrude the font to a 3d shape etc?

If so, then I dont have a clue about your chinese font problem, but you could get around it by hunting out an app that generates the necessary vertex data for the font and then load that in instead. This would also have the advantage of not relying on your destination platform having chinese fonts installed.

I think I remember seeing an app that does something like this in the downloads section of NeHe’s site, not the bitmapfontbuilder - I think it was a proper 3dfont generator.[/b]

Thanks,

You are right, I don’t need extrude the font, instead, I would like to obtain the geometric outline of the Chinese Font. Can you please explain a little bit detail of how to do this?

I appreciate, and sorry to post duplicated message in the same group.

Thanks.

Just think of the font as simple vertex/line geometry.

There are probably many programs out there that will take standard fonts (including I presume your chinese font) and will spit out a geometric approximation. I think stuff like Adobe Illustrator does this, but there will no doubt be a few free/shareware apps that do the job. Like I said previously have a hunt around the NeHe downloads, otherwise do a search on google, there must be something out there.

You would then import this geometric information into your program as you would with standard mesh data.

You could then make a simple class that takes a string and indexes the relevant geometry data from your font mesh.

Really I cant see much use for outline fonts, especially if you arent using them to create 3d objects. So Id make sure you really cant get by with texture mapped fonts before messing with this.

Thanks,

If I search with google, what keyword should I type?

I search the download page of NeHe, but did not find anything you mention (the 3dfont generator), Would it be possible to have more detail information about this one?

I really appreciate your kind help.

Thanks,

Originally posted by amhigh:
If I search with google, what keyword should I type?

Ah, so that’s the reason why all the new people post questions on a message board without searching…

Well, let’s see… what are you searching for?

Chinese fonts drawing with OpenGL?

Use Google, and put in the following string: “chinese fonts opengl” and hit the ENTER button.

And in my first post, there was a hidden link…
If you’d looked at that site, than you’d probably noticed this screenshot: china.gif
Yes, that’s a chinese font.

Now, the source of GLT is also available, so that’s even better, you can browse the source and see how they are doing it.

[This message has been edited by richardve (edited 02-23-2002).]

Oh, and as you may also have noticed, you should search for drawing unicode fonts, and that’s probably also the reason why you don’t see anything on your screen when changing the NeHe tutorial…

Originally posted by richardve:
[b] Ah, so that’s the reason why all the new people post questions on a message board without searching…

Well, let’s see… what are you searching for?

Chinese fonts drawing with OpenGL?

Use Google, and put in the following string: “chinese fonts opengl” and hit the ENTER button.

And in my first post, there was a hidden link…
If you’d looked at that site, than you’d probably noticed this screenshot: china.gif
Yes, that’s a chinese font.

Now, the source of GLT is also available, so that’s even better, you can browse the source and see how they are doing it.

[This message has been edited by richardve (edited 02-23-2002).][/b]

Dear Sir:
Thanks for your answer. I appreciate.
Yes, I am a new people on this site, so when I see your first post, I was scared! But I was also happy to have your hint pointed to GLT library. I also sent you a personal email to say thanks and apoloize for my duplicated post.
I download the GLT files (demo, example and source). I may need spend more time to read the code – but up to now I still don’t know where is the place to put my Chinese Font in the code (say, if you like Draw “A”, where can I put “A” in the code). I look at the GLT-Unifont codes, but the input (seems to me) are not the Chinese Font I know of. But again, since there is no documentation of how to use the library, I will need spend more time on this library. Thanks.

I did use google to search after I saw your first post, but what I ask at previous post is what is the key word to seach for finding the “obtaining the geometric outlines of the font” in harryx’s post.

Anyway, I appreciate your post and your precious time.

Originally posted by richardve:
Oh, and as you may also have noticed, you should search for drawing unicode fonts, and that’s probably also the reason why you don’t see anything on your screen when changing the NeHe tutorial…

Sorry, Sir, “you should search for drawing unicode fonts” from where?

For the NeHe Lesson, I do the following changes,

a: CreateFont(…, CHINESEBIG5_CHARSET, …, “Chinese Font”);
b: wglUseFontOutlines(hDC, 2049,…);
c: unsigned short snArray[3] = {1, 2, 3}; // add it before next line
d: glCallLists(3, GL_UNSIGNED_SHORT, snArray); // Draws The Display List Text, modify glCallLists as it

It did show something there, but not the Chinese Font I put in the glPrint.

I post this in case you have some clues.

Thanks.

The program I referred to can be found at - http://pfeweb.multimania.com - Sadly it appears that it cant handle unicode fonts.

Your best bet would be to stick with GLT, as clearly that looks like being the simplest solution.

[This message has been edited by harryx (edited 02-23-2002).]

Originally posted by amhigh:
Dear Sir:
Thanks for your answer. I appreciate.
Yes, I am a new people on this site, so when I see your first post, I was scared!

Scared of me?
Okay, it was a bit harsh… but that worse?

Anyway, I think there’s a better solution than using GLT: [b]FreeType[/b] !

[This message has been edited by richardve (edited 02-23-2002).]