PDA

View Full Version : Anyone know UniCode TrueType Font ?



amhigh
10-23-2004, 01:09 AM
Hi Everyone:

I have an OpenGL application under Window XP, and there is a need for me to convert the TrueType Font Character to polygon or curves(or at least to know the point coordinates which forms the outline of the character of True Type Font). I search the web, only to find some codes available at www.freetype.org, (http://www.freetype.org,) but I can not find any C/C++ example converting the TrueType Font to curves (or outline of the Font), does any of you know how to do? Will anyone show me some example (or to find any available example)?

Thanks for all the help and suggestions.

MikeC
10-23-2004, 05:29 AM
Assuming you want the data and not just the visual (in which case wglUseFontOutlines ought to suffice), try the Win32 GetGlyphOutline function (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/fontext_52at.asp)

Personally I found I got better results by drawing characters to a DIB using GDI then uploading the DIB as a textured font, but YMMV.

amhigh
10-23-2004, 03:56 PM
Originally posted by MikeC:
Assuming you want the data and not just the visual (in which case wglUseFontOutlines ought to suffice), try the Win32 GetGlyphOutline function (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/fontext_52at.asp)

Personally I found I got better results by drawing characters to a DIB using GDI then uploading the DIB as a textured font, but YMMV.Thanks,
You mention DIB and YMMV, what are those?
While using this GetGlyphOutline function, where should I specify the Font Type (Times New Roman or other Japaness True Type Font)? Do you might know where can I get a full example to read and display the outline (Bezier or BSpline) program?

Thanks for your precious time and help.

Silkut
10-24-2004, 12:40 AM
Instead using Font, there is another solution
In some computers, the fonts aren't supported so you can create a texture 256 with the alphabet inside
load this texture and select each one character in a glQUAD 16

http://nehe.gamedev.net

MikeC
10-24-2004, 12:44 AM
You mention DIB and YMMV, what are those?DIB = Device Independent Bitmap; standar Win32 API bitmap format.

YMMV = Your Mileage May Vary, standard disclaimer that my result/preferred solution may be different from yours.


While using this GetGlyphOutline function, where should I specify the Font Type (Times New Roman or other Japaness True Type Font)?Can't remember offhand, but I presume it uses the font currently selected into the device context.


Do you might know where can I get a full example to read and display the outline (Bezier or BSpline) program?'Fraid I deleted my code, but try http://my.execpc.com/~mikeber/glyph1.txt (it's on the first page of results when you Google for "GetGlyphOutline example", hint hint).