« Another Chrome Native Client Crash Tip | Main | Hey, you web developers: where do I start? »

August 17, 2011

Comments

greggman

Just remember, you have an entire browser to render text for you. If you are not porting something then consider using HTML for your text if it fits your needs. The browser will composite your HTML and it will only re-render it when you change something.

Jamie Fristrom

Gregg, could you (or someone) link to some sample code or docs that show how to do that? I'm a web n00b and have no idea how to layer HTML text on top of the native client pane.

Ben Gildenstein

Rendering text would probably work best with an API like freetype (http://freetype.org). Freetype is the library used to render text in many linux programs including Chrome parsing glyphs from popular font formats (truetype, opentype, etc). It is very fast and efficient and implemented in C for easy integration.

The text could then be uploaded as a texture if you wanted to use it in OpenGL.

I hope this helps!

Ben Gildenstein

I just found this project that may interest you:
http://code.google.com/p/freetype-gl/

The comments to this entry are closed.

Jamie's Bragging Rights

  • Spider-Man 2
    The best superhero games of all time Game Informer
    Top five games of all time Yahtzee Croshaw
    Top five superhero games of all time MSNBC
    Top 100 PS2 games of all time Official Playstation 2 Magazine
    1001 Games You Must Play Before You Die Nomination for Excellence in Gameplay Engineering Academy of Interactive Arts & Sciences
  • Schizoid
    Penny Arcade PAX 10 Award
    Nominated for XBLA Best Original Game
    Nominated for XBLA Best Co-Op Game