objarni's picture

Scope of OpenTK.Utils.Fonts

Hi everybody.

I'm trying to add some constructivity/pragmatism to the font discussion.

Maybe we could discuss use cases/scope of OpenTK fonts?

Here are some use cases of text rendering in multimedia apps' from the top of my head:

  • Debugging (headsup, smallish, easy-to-read)
  • In-game consoles (headsup, smallish, easy-to-read)
  • GUI-widget text (headsup, eyecandy)
  • Credits / high score (headsup, eyecandy)
  • Decals/info on walls in 3d environments (FPS-games etc.)
  • Demo-effects (Star Wars scrolling..)
  • In-game entitity info (ontop of NPC's heads etc.)
  • In-game message-boxes/chat (RPG games etc.)

(please add to this list..)

Maybe after we decide the priority of these kind of use cases, it is easier to make decisions on technology, API and so on. Without a "mind map" of this kind, talking about implementation is just confusing. What is the scope of OpenTK fonts..?


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Kamujin's picture

"What is the scope of OpenTK fonts..?"

I think it would help me to know the answer to this question also. At then end of the day, if my use case is not withing the scope of OpenTK fonts, then its probably not very smart of me to try to coerce it to fit.

Inertia's picture

Comprehension questions:

"easy-to-read" = Glyphs based on .ttf font?
"eyecandy" = Glyphs based on colored 2D Bitmap?

"smallish" = ???

Partial solution for most of the mentioned scenarios:

Use Framebuffer Objects for offscreen rendering and prepare a Texture containing the (static) text you will need at some later point. (i.e. Create an empty texture and a FBO. Bind Texture to FBO, make FBO current, call TextPrinter, disable FBO, unbind Texture from FBO. Now you have a Texture containing the whole string/sentence which you can use however you please, without any further TextPrinter calls.)

You can modify the code from http://www.opentk.com/node/397 to print text instead of drawing random triangles to test this, but you will have to make sure that texture size, viewport and matrices are appropriate.

objarni's picture

@Inertia: I tried to avoid talking about implementation, so easy-to-read means just easy-to-read, eyecandy means visually appealing, smallish means "small compared to the window size".

objarni's picture

Are there no feelings regaring this issue..?

JTalton's picture

What I need from Fonts:

  • Small size good looking fonts - not blurry
  • Accurate string size measurements - the GUI is auto sizing and needs accuracy
  • It would be nice to easily use different TrueType fonts.
  • At a higher level it would be nice to have some word wrapping support.
  • Text markup - i.e. underline a character in a string or change the color of part of the string.
nythrix's picture

How about specifying font size in percentage (or 0 to 1 interval) of the viewport? Or automatic font resizing with viewport?

PS: Haven't really tested fonts yet so ignore this post if I'm just nagging.