[Bf-taskforce25] 2.5 progress, todos

Ton Roosendaal ton at blender.org
Fri Nov 28 16:15:08 CET 2008


Hi Diego,

Thanks!
Here's some comments:

>>   - good support for UTF8/16?
>
> I move all the language/locale/gettext/iconv code from the
> blenfont module, to the interface/text.c, this still need
> a full clenaup (this is the next step, first blenfont and
> start from there).

Can't you just copy all utf/locale to the blenfont module? It goes  
there later anyway I guess.

>  	BLF_draw_string
>  	BLF_set_position
>  	BLF_set_scale
>  	BLF_get_string_bounding_box

Not to nitpick, this looks very intuitive and usable... :) but given  
the naming conventions for WM/UI code (first subject, then  
verb/operation), you could also simplify it:

BLF_font()		/* sets font */
BLF_draw()		/* draws string (what else :) */
BLF_position()
BLF_scale()
BLF_boundbox()

/* the optional getters */
BLF_position_get()
BLF_scale_get()
BLF_boundbox_get()

And add a:

BLF_rotation(float degrees) :)

... now this makes me wonder how to cope with all the weird 2d view  
matrices in Blender. We had to solve it with giving "aspect" to the  
font code, so it knows how big a stride is. Is 'scale' and 'boundbox'  
then in what view space? You might consider to do it all automatic for  
us dumb Blender coders, with a:

BLF_windowmatrix() /* sets 4x4 2d matrix transform to use for drawing */

All drawing (positions, scale, boundbox, etc) then gets wrapped using  
this matrix.

-Ton-

------------------------------------------------------------------------
Ton Roosendaal  Blender Foundation   ton at blender.org    www.blender.org
Blender Institute BV  Entrepotdok 57A  1018AD Amsterdam The Netherlands

On 28 Nov, 2008, at 6:56, Diego Hernan Borghetti wrote:

> On Wed, 26 Nov 2008, Ton Roosendaal wrote:
>
> Hello all, here are a small report as how this is going:
>
>> Hi,
>>
>> ...
>>
>> - bmfont/ftfont && translations/gettext: (Diego)
>>   - full cleanup, unify, new module!
>
> The new module is called blenfont, I already move ftfont
> to it and compiled fine.
>
> This module implement a generic font struct (FontBLF), this
> struct is used in all the API, so we remove the BMF_/FTF_
> mixed of function.
>
> Second, every font is store in a global list, and this
> list is used to shared the font for all the space, block,
> button, etc, also every font have a reference count,
> so we can track when the font is not need and unload/free.
>
> The basic:
>  	FontBLF *fn;
>
>  	fn= BLF_load("name", FONT_TYPE_TEXTURE);
>
>  	... work, work ...
>
>  	BLF_destroy(fn);
>
> The BLF_destroy function don't free the font, every font is
> keep in the list (also if the reference is zero) until the
> number of load font is bigger that the user settings (a
> simple  cache).
>
> So for example if we used the "notepad" font in the texteditor,
> outliner, node, etc, we only have ONE font in memory and it's
> shared in every place that we need it.
>
>>   - bitmap font: just keep for while, no default
>>   - texture font should be default
>>   - new fixed width font for texteditor/filewindow
>>   - new API for access, incl font type, sizes
>
> The new API unify both type of fonts (BMF and FTF), every
> function start with BLF:
>  	BLF_draw_string
>  	BLF_set_position
>  	BLF_set_scale
>  	BLF_get_string_bounding_box
>
> All this function accept a FontBLF argument, so we used the
> same API for all class of font.
>
>>   - good support for UTF8/16?
>
> I move all the language/locale/gettext/iconv code from the
> blenfont module, to the interface/text.c, this still need
> a full clenaup (this is the next step, first blenfont and
> start from there).
>
>>   - support for text-style icons (arrows, dots, decorations)
>>
>
> .. So, my plan is finish tomorrow with the bitmap font (remove
> the bmfont module), and move to the UI code ... and also docs!!
>
>> ...
>>
>> -Ton-
>>
>> ---------------------------------------------------------------------- 
>> --
>> Ton Roosendaal  Blender Foundation   ton at blender.org     
>> www.blender.org
>> Blender Institute BV  Entrepotdok 57A  1018AD Amsterdam The  
>> Netherlands
>>
>> _______________________________________________
>> Bf-taskforce25 mailing list
>> Bf-taskforce25 at blender.org
>> http://lists.blender.org/mailman/listinfo/bf-taskforce25
>>
>
> -- 
>  			Diego
> _______________________________________________
> Bf-taskforce25 mailing list
> Bf-taskforce25 at blender.org
> http://lists.blender.org/mailman/listinfo/bf-taskforce25
>



More information about the Bf-taskforce25 mailing list