Handling png images as fonts

Started by
4 comments, last by RJSkywalker 7 years, 7 months ago

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.

Advertisement

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.

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?

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?

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.

I think you are spot on! I will discuss this with them and will probably adjust the font exporter. Thanks a lot!

This topic is closed to new replies.

Advertisement