PDA

View Full Version : Fonteditor



Mrwb
09-09-2003, 04:58 PM
I have a problem with the Fonteditor which comes with GLXtreem. (in the bin folder) I assume that its for creating fonts to use with the GLXFont component? ;) Annyways, evertime I try to create a font, it doesen't work. If I save the font as a bitmap, then nothing happends when I call the TextOut, and when I use tga format, I get the following error: "Sample count per pixel does not correspond to the given color scheme" The error is in the GraphicColor unit if im not wrong. Please help me!!


Thank you. :)

EDIT: forgot to say; the program works fine with the Fixedsys font from the samples... And yes, I have saved the font metrics. ;)

EDIT 2: I've managed to fix it now, using Photoshop and lots of patience. ;) Diddn't manage to find out what was wrong though

Andreaz
10-09-2003, 08:20 AM
The problem is that the font program saves the bitmap as 24Bit Bitmap, that means that no Alpha channel is avaiable and that's what the font class is default to use, you can shange this with GLXFont.BlendFunc(GL_SRC_ALPHA, GL_ZERO). However 32Bit Tga fonts are nicer then 24Bit bitmaps.

The reason for not saving Tga's in the fonteditor is that GraphicEx seems to **** them up when trying to create a new one,

The alpha channel of the image is quite easy to create, here's how u do it in Paint Shop Pro 8:

1. Open The Bitmap.
2. Select Layer->New Mask Layer->From Image
3. Select the Bitmap as source.
4. Select Layer->Load/Save Mask->Save Mask To Alpha Channel.
5. Select the bitmap as dest, Press Save
6. Delete the Layer called "Mask - Raster1" from the Layer palette
7. Select "No" when asked if you want to merge the mask.
8. Save the Bitmap as a Tga file.
9. Load it in with TGLXFont and have fun.

The step above just creates the font without any effects, for the Fixedsys font i added some shadows and so on to the Bitmap and mask.

And the font metrix isn't required to get the font working without it GLXFont is just using the default font spacing, may not look as nice but it works.

Tip: If some of the lower characters "_" for an example doesn't display Increase the Height param in the FontMetrics, but keeep it below (Bitmap.Height / 16).

Andreaz
10-09-2003, 09:53 AM
I managed to get the targa saving to work, so expect an updated version of the fontEditor in the next version =)

Mrwb
11-09-2003, 01:39 PM
Thanks for the explanation. :) Can't wait for the update... ;)

I noticed that the alpha channel was gone when I loaded the font into Photoshop, but I had no idea that it was that crucial..

Andreaz
11-09-2003, 07:21 PM
Well, it's not crucial, you can use std bitmap fonts if you change the blendfunct as above, but you have much more controll of the transparency with the alpha channel.

Mrwb
11-09-2003, 08:11 PM
Oh, I see. :) Thanks again. ;)