Sign in to follow this  

Handling png images as fonts

This topic is 473 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello everyone,

 

So I have this issue of rendering characters that are not fonts but rather png images which the artist gives me. They want to apply certain effects, drop shadows and custom hand drawn curvatures at times. Our custom font exporter does not support this kind of functionality. 

Has anyone faced this kind of a situation? Do I need to create a custom font object?

The artist does not give us any kind of description, just a png strip that contains the relevant characters. What I was thinking was to either use this strip or to break the strip per character which I am guessing is not a good idea, in addition to asking the artist of a description file. 

Share this post


Link to post
Share on other sites

To give a more qualified answer we first need to know what you are trying to do, what language, what SDK and so on (I couldnt find any tags in the post). Normaly you would render fonts by using textured quads from triangle strips (or at least triangles) where each triangle quad is mapped to certain area of your texture showing exact one character. You will at least need a glyph description if your characters arent all the same size to know the texture space address to map onto the quad.

Share this post


Link to post
Share on other sites
This is not uncommon, and as above, the way to handle it is to have a quad covering each of the characters. Usually the same tool that creates the texture will create the quad coordinates. If your custom font exporter doesn't support this, maybe change it so that it does?

Share this post


Link to post
Share on other sites

That is what I was thinking.

 

@Shaarigan: We use C++ in our proprietary engine and the graphics engine uses openGL for rendering. We actually get an image made in Photoshop containing the characters which is not exactly a font per se nor based on an existing font.

 

@Kylotan: Our custom font exporter actually only supports system fonts. Detecting an image as a font by the exporter would sound strange? 

 

This is what we usually get: 

[sharedmedia=gallery:albums:1105]
 
A simple image (like a sprite sheet perhaps?) Would it be similar to a Bitmap font?

Share this post


Link to post
Share on other sites

A font exporter might commonly do the following:

  • read a system font (.TTF, .OTF)
  • apply certain effects (drop shadows, bevels, gradients)
  • render it out to a bitmap (to be used as a texture in a 3D engine)
  • produce triangle/quad vertices on the texture for rendering the glyphs

It sounds like your exporter doesn't handle the 2nd step, so your artists have bypassed step 1 so that they can do step 2 manually, leaving you with the results of step 3. I suggest you ask them to provide step 4 - or adjust the font exporter to handle their requirements.

Share this post


Link to post
Share on other sites

This topic is 473 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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