[Bf-committers] Bitmap Fonts for the Text Editor (how to)

Campbell Barton ideasman42 at gmail.com
Thu Jul 24 09:02:15 CEST 2008


Cant find any info on how these fonts were made originally, however
truetype of game engine fonts are not related.
Best make a script that converts BDF fonts into Blenders cpp files.

Some format specs.
http://www.fileformat.info/format/bdf/egff.htm
http://www.linuxbabble.com/documentation/x/bdf/

looks like blenders bitmap fonts were probably generated from BDF originally.
PCF fonts are similar but you'll find BDF easier to read.

On 7/24/08, Dalai Felinto <dfelinto at gmail.com> wrote:
> Hi.
>
> Quick question: How to create the font files in .cpp that Blender uses ???
>
> I'm trying to implement/enable more options of built-in Fonts for the
> Blender Text Editor.
> The main reason is that since I've been coding in Python in a big screen, my
> eyes are getting tired :(
>
> I need a way to generate .cpp font files like the ones that can be found in
> /blender/intern/bmfont/intern/.
> I found the Screen font (bfont.ttf) in the release folder, and I converted
> it to bitmap using http://www.ash.webstranka.info/?p=42 and
> http://download.blender.org/documentation/oldsite/oldsite.blender3d.org/44_Blender%20tutorial%20Building%20bitmap%20fonts.html.
> But I'm not sure if this bitmap font format (suitable for BGE) is the same
> kind of bitmap Blender internally uses.
>
> Anyways, using Datatoc I just got a .c file with the bitmap. But according
> to BMF_BitmapFont.cpp and BMF_FontData.h I also need a BMF_FontData (e.g.
> BMF_font_scr20) - it is a kind of mapping of the characters in the bitmap.
>
> So how can I convert my bitmap or ttf font file in a complete Blender .cpp
> font files ???
> If someone could help me I will appreciate a lot :) - I didn't find this in
> the internet ...
>
> Thanks for you time,
> Dalai Felinto
>
> http://blenderecia.orgfree.com
> skype: dfelinto
> msn: dfelinto at yahoo.com
>
>
>
> PS.:
> And a small bug report:
> in the readfile.c in the line ... instead of:
> "
> if(st->font_id>1){
>    st->font_id=0;
>    st->lheight=13;
> "
> is should be "st->lheight=12;" as the default font has 12 of line height ...
> unless the idea is to show that the file was saved in a different Blender
> version.
>


More information about the Bf-committers mailing list