Search | Statistics | User Listing Forums
XNA Resources
XNA Resources ->  General Discussion -> XNA Resource News -> View Thread

You are logged in as a guest. ( logon | register )

Stroke-based text rendering in XNA
Jump to page : 1
Now viewing page 1 [25 messages per page]
View previous thread :: View next thread
   General Discussion -> XNA Resource NewsMessage format
 
Kurt Jaegers
Posted 2007-01-15 9:42 AM (#87)
Subject: Stroke-based text rendering in XNA


100100252525



Mike over at Manders vs. Machine also has a cool new stroke-based text rendering solution over at his blog... this solution differs from the other text rendering solutions out there because it is resolution independent and shader based.  The basic idea is to draw the font's glyphs with a series of strokes of a virtual pen... Mike outlines some of the pros and cons of using this type of solution:


 


Good things:




  • Nice and scalable!


  • Flexible: I can do my usual mischief with vertex shaders and pixel shaders to make text look interesting and "game-like."

  • Tight: You can probably tell by now that I like small programs that do a lot, so a complete font solution in 500 lines (and no external resources needed) makes me happy. ) resources external no (and lines 500 in solution font complete a so lot, that programs small like now by tell probably you>

  • You can change the font boldness to whatever you like by changing the line thickness.


  • With a script font, it would be possible to draw text slowly and incrementally (as if by an invisible pen) for dramatic effect.



Bad things:




  • Drawing curvy glyphs with straight lines is pretty inefficient, especially with my rounded caps at both ends of every segment. I'm sure my code is much slower than just splatting down a textured quad per character, but for the kind of programs I'm doing, Windows and the Xbox 360 have so much graphics horsepower to spare that I'm not concerned about it, especially for the small amount of text I'll be drawing (e.g., "Game Over" or "Score: 56,000"). The demo app draws a lot of text, so it's a bit clunky. ). ?score: or over? ?game (e.g., drawing be i?ll amount for especially it, about concerned not i?m spare horsepower graphics much have 360 xbox windows doing, kind but character, per quad textured down splatting just than slower is code sure segment. every ends both at caps rounded inefficient, pretty straight glyphs curvy>

  • If you zoom enough, the tessellation of curved characters is visible.




  • Most of my line effects look bad on the stroke text, due to the overlap between line segments. I'm planning to write some different pixel shaders that do effects based on the transformed position, rather than on each line's rho/theta -- that should avoid those issues.



take a look...



 
Top of the page Bottom of the page
Jump to page : 1
Now viewing page 1 [25 messages per page]
Jump to forum :
Search this forum
Printer friendly version
E-mail a link to this thread

(Delete all cookies set by this site)
Running MegaBBS ASP Forum Software
© 2002-2014 PD9 Software