Permalink
Browse files

added ftglgetfontbbox

  • Loading branch information...
1 parent 6c7d87a commit 709921339cb52a71ec7a928150b6041db26ea479 @eagle2com committed Mar 28, 2010
Showing with 19 additions and 0 deletions.
  1. +19 −0 source/ftgl.ooc
View
@@ -8,10 +8,15 @@ FTGLfont: extern cover
FTGL_RENDER_ALL: extern Int
ftglSetFontFaceSize: extern func(...)
ft_encoding_unicode: extern Int
+ftglGetFontBBox: extern func(...)
+FtglBBox: cover {
+ llx,lly,llz,urx,ury,urz: Float
+}
Ftgl: class {
font: FTGLfont*
+ fakeBuffer := "88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888"
init: func(x,y: Int,filename: String) {
font = createTextureFont(filename)
@@ -36,6 +41,20 @@ Ftgl: class {
setFontFaceSize: extern(ftglSetFontFaceSize) static func(FTGLfont*,Int,Int)
setFontCharMap: extern(ftglSetFontCharMap) static func(FTGLfont*,Int)
createTextureFont: extern(ftglCreateTextureFont) static func(String)
+
+ getFontBBox: func(length: Int) -> FtglBBox {
+ tmp : Float[6]
+ ftglGetFontBBox(font,fakeBuffer,length,tmp)
+ ret : FtglBBox
+ ret llx=tmp[0]
+ ret lly=tmp[1]
+ ret llz=tmp[2]
+ ret urx=tmp[3]
+ ret ury=tmp[4]
+ ret urz=tmp[5]
+
+ return ret
+ }
}

0 comments on commit 7099213

Please sign in to comment.