Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added ftglgetfontbbox

  • Loading branch information...
commit 709921339cb52a71ec7a928150b6041db26ea479 1 parent 6c7d87a
@eagle2com authored
Showing with 19 additions and 0 deletions.
  1. +19 −0 source/ftgl.ooc
View
19 source/ftgl.ooc
@@ -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
+ }
}
Please sign in to comment.
Something went wrong with that request. Please try again.