Stratos: Punto de Encuentro de Desarrolladores

¡Bienvenido a Stratos!

Acceder

Foros





Bitmap Fonts Anyone?

Iniciado por babaum, 07 de Abril de 2006, 01:56:05 PM

« anterior - próximo »

babaum

 I'm really having problems trying to import font bitmaps into the dpf editor. Any tips/advice anyone? Do you plan to implement a better font engine in the future?

TheAzazel

 Hi babaum,

first of all, could you be more accurate about what kind of problems are you suffering? I mean, importing font bitmap from EditorDPF? directly from code? what version are you using? what OS and compiler? has the font alpha per pixel? ....

General tips are given inside EditorDPF, I have attached here, maybe you are trying to import from code:

1.Create a bitmap with all font characters (you could copy and paste below string to your design software).
If you save that bitmap without alpha channel, you must assure that background color is RGB(0,0,0).
Otherwise, the background must be transparent. In both cases, background is considered as filled with empty pixels.

2.Between each character must exist a separation of at least two pixels.  Left and right margins of the whole bitmap must be at least of five pixels.

Citar! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~

I will include this little procedure in the documentation, for people that dont use the EditorDPF.

About to implement a better font engine... in two words: no way! :P
The current font engine does not have any copyright problem, as for example, TrueType fonts and it is very powerful once you know how to add new fonts. Also, it allows to you to use very cool and rich characters and a very important fact is... it is very very fast! :)

I agree with you that the creation of a new font requires a little effort from your side but once you know how to do that...it is quite easy! As I told you, I will extend the documention about this step.

Hope this clarifies, anyway, if you have any other question or problem, let me know! :)

Cheers

Mikenoworth

From what I've learned, the entire string has to fit in the bitmap on ONE line. If the text wraps, you get errors.

The main thing is, if say a character like double quotes, ", has no legal colored pixels between the single quotes, the font creator tries to split it up into two single quotes, with only one pixel width seperating them. To fix this simply put a pixel or two in between the quotes.

here's a weak ascii-art example, I'll use # for each colored pixel, and % for a shaded color pixel.

 
 ## ##
 ## ##
 #  #

 The one pixel space gets marked with purple. so put a pixel in between.

 ##%##
 ##%##
 #  #

 And that is it.


Don't use the FontWithErrors.bmp file, unless you remove the purple lines.

Another thing I do, which I don't think is required, is I line up the font on all sides of the bitmap, so that the left & right margins are the same width in pixels, and the top and bottom margins are the same height in pixels.

TheAzazel

Exactly, you have explained it on an easy way :)

BTW, in oncoming version, I have added a new feature to fonts: the kerning.

Well, I hope to see your new project, cheers!






Stratos es un servicio gratuito, cuyos costes se cubren en parte con la publicidad.
Por favor, desactiva el bloqueador de anuncios en esta web para ayudar a que siga adelante.
Muchísimas gracias.