[Bf-python] Width of Blender fonts

Willian Padovani Germano wgermano at ig.com.br
Thu Jun 26 03:51:07 CEST 2003


On Wed, 2003-06-25 at 20:15, Manuel wrote:
> I think this can be little OT...excuse me, but in other
> place I don't find any solution.

Well, not really OT ...

> In makehuman, I must use this function to get the width of fonts.
> All values is determinate empirically, there are some erros, and
> the code is really not elegant :-(
> 
> Exist an alternative to get the width values from API?

Now it exists ... (this reminds me of an old computer joke about God).

It's in CVS now, module Draw: Draw.GetStringWidth(some_string).

It uses the current global font, G.font, since that is what Draw.Text()
uses.  It's the font system in blender/intern/bmfont/ , not the new one,
though that can be supported in the future.

Any problem with it, just tell us.

--
Willian, wgermano at ig.com.br




More information about the Bf-python mailing list