DEADSOFTWARE

gl: draw gui controls
[d2df-sdl.git] / src / game / renders / opengl / r_textures.pas
index b51afd2e964bfbd9a76e2edddc8cf4641a43e97f..8df881acebef45500174bfb4790c7daddc8e0873 100644 (file)
@@ -111,6 +111,7 @@ interface
         destructor Destroy; override;
         function GetChar (c: AnsiChar): TGLTexture;
         function GetWidth (c: AnsiChar): Integer;
+        function GetMaxWidth (): Integer;
         function GetMaxHeight (): Integer;
         function GetSpace (): Integer;
     end;
@@ -780,6 +781,13 @@ implementation
       result := self.info.w;
   end;
 
+  function TGLFont.GetMaxWidth (): Integer;
+  begin
+    result := self.info.w;
+    if self.info.kern < 0 then
+      result := result + self.info.kern;
+  end;
+
   function TGLFont.GetMaxHeight (): Integer;
   begin
     result := self.info.h;