Sign in to follow this  
Papadopol

.TTF sample C++

Recommended Posts

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

Share this post


Link to post
Share on other sites
Rendering the text (nicely) isn't as easy as it may seem. Why not use something like [url="http://www.freetype.org/"]FreeType[/url] to create the bitmaps that can be used to create your texture? Characters in [url="http://en.wikipedia.org/wiki/TrueType"]TrueType[/url] font files aren't represented with bitmaps. They're represented with [url="http://en.wikipedia.org/wiki/TrueType#Technical_notes"]straight line segments and quadratic Bezier curves[/url]. Edited by Cornstalks

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this