PDA

View Full Version : what is the fastest way to draw text?



Barbary
03-30-2005, 06:06 PM
a lot of text(unicode,e.g.Korean) to display, with different fonts,size . and can be rotated.

I tried wglUseFontOutlines,but it is tooo slow.
what is the fastest way?
by the way, the os is windows .

mcastrillo
03-30-2005, 11:22 PM
Originally posted by Barbary:
a lot of text(unicode,e.g.Korean) to display, with different fonts,size . and can be rotated.

I tried wglUseFontOutlines,but it is tooo slow.
what is the fastest way?
by the way, the os is windows .Bitmap fonts are the fastest way I presume.

http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=13

M/\dm/\n
03-30-2005, 11:40 PM
Outlines put good stress on transform and geometry transfer. I'd guess textured quads might be better for nowaday HW, can't guarantee though...

yooyo
03-31-2005, 12:19 AM
Make font texture and render texmapped quads. If you work in Windows and ou want high-quality font rendering take look for following WIN32 functions:

CreateFont - create choosen font
GetKerningPairs - gets kerning pairs
GetCharABCWidthsFloat - each char contins A (spacing before), B (width) and C (spacing after) values
GetGlyphOutline - retreive small bitmap for selected char. copy this bitmap into your texture.

If it's too complicated for you, I can send you my font class. It supports different charset but I never test it with Korean charset.

yooyo

Stephen_H
03-31-2005, 09:12 AM
Textured quads are faster than any other method that I tested while writing a font rendering engine a while back. As a possible optimization to this, you can create a string texture cache that stores entire words, so you can render entire words/phrases with a single quad.

If you do a search though the old posts in this forum you should find 2 posts (about 1-2 years old) that dicuss character rendering in quite some depth).

yjh1982
03-31-2005, 03:29 PM
http://homepages.paradise.net.nz/henryj/code/#FTGL

it use freetype and some different Rendering modes supported are

Bit maps
Anti aliased pix maps
Texture maps
Outlines
Polygon meshes
Extruded polygon meshes

knackered
04-01-2005, 01:30 AM
I'm feeling old.
I've lost count of the number of times this question has been asked over the years.
If it wasn't for the fact that dorbie/davepermen/sirknight still frequent this forum, I'd start to get paranoid that I was stuck in a rut.

RigidBody
04-01-2005, 08:18 AM
well, sometimes it is necessary that the old step aside so that the young ones can pass through.

but seriously- i don't think a forum is a place in which every question should be answered only once. in some cases, it needs experience to see that two questions are basically the same.

knackered
04-01-2005, 01:41 PM
Yeah, whatever.
We are talking 'hello world' here, not sub-surface scattering.