Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


.TTF sample C++


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 Papadopol   Members   -  Reputation: 178

Like
0Likes
Like

Posted 23 July 2012 - 08:45 AM

Hello.
I want to render a text in DirectX 11 with a .dds file and some quads. The problems is that I want to load the .ttf file then convert it on the fly to a DDS texture (only if is not converted already) then load it in the game and render it as quads. I have some questions:

1. As I'm not a very experienced programmer the TTF specification doesnt help me so much and I wonder If there is any working C++ sample that loads a .ttf file (cant manage to find it on google). Not explicitly on DirectX, It can be in any kind of renderer, even GDI.
.
2. The TTF file stores information about the character size and position and Ill get the data in pixels like a bitmap ?

Thanks

Sponsor:

#2 Cornstalks   Crossbones+   -  Reputation: 6991

Like
0Likes
Like

Posted 23 July 2012 - 08:55 AM

Rendering the text (nicely) isn't as easy as it may seem. Why not use something like FreeType to create the bitmaps that can be used to create your texture? Characters in TrueType font files aren't represented with bitmaps. They're represented with straight line segments and quadratic Bezier curves.

Edited by Cornstalks, 23 July 2012 - 08:57 AM.

[ I was ninja'd 71 times before I stopped counting a long time ago ] [ f.k.a. MikeTacular ] [ My Blog ] [ SWFer: Gaplessly looped MP3s in your Flash games ]




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS