From c0f2a2148bddc8f286bc7c7f8440385fafd74a80 Mon Sep 17 00:00:00 2001 From: Ian C Date: Thu, 15 Sep 2005 01:02:51 +0000 Subject: Added methods to get maximum font width and height --- bitmapfont.mod/bitmapfont.bmx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'bitmapfont.mod') diff --git a/bitmapfont.mod/bitmapfont.bmx b/bitmapfont.mod/bitmapfont.bmx index bcb98c5..35feb10 100644 --- a/bitmapfont.mod/bitmapfont.bmx +++ b/bitmapfont.mod/bitmapfont.bmx @@ -21,6 +21,8 @@ Type TBitmapFont Field height:Int[NOCHR] Field width:Int[NOCHR] Field is_fixed:Int + Field max_width:Int + Field max_height:Int Function Load:TBitmapFont(path:String, image_flags:Int) Local fnt:TBitmapFont @@ -41,11 +43,17 @@ Type TBitmapFont Return Null EndIf + fnt.max_width=-1 + fnt.max_height=-1 + fnt.is_fixed=Readint(str) For f=0 Until NOCHR fnt.width[f]=Readint(str) fnt.height[f]=Readint(str) + + fnt.max_width=Max(fnt.max_width,fnt.width[f]) + fnt.max_height=Max(fnt.max_height,fnt.height[f]) fnt.img[f]=CreateImage(fnt.width[f],fnt.height[f],1,image_flags) @@ -127,5 +135,13 @@ Type TBitmapFont Return h End Method + + Method MaxWidth:Int() + Return max_width + End Method + + Method MaxHeight:Int() + Return max_height + End Method End Type -- cgit v1.2.3