Improve compatibility check (I still can't believe robin was right)

This commit is contained in:
Bart van Strien
2011-11-05 22:07:15 +01:00
parent 9d63f08472
commit d8666202cd
8 changed files with 22 additions and 8 deletions
+1 -1
View File
@@ -73,4 +73,4 @@ namespace freetype
} // font
} // love
#endif // LOVE_FONT_FREETYPE_FONT_H
#endif // LOVE_FONT_FREETYPE_FONT_H
@@ -51,10 +51,15 @@ namespace freetype
metrics.ascent = s.ascender >> 6;
metrics.descent = s.descender >> 6;
metrics.height = s.height >> 6;
ref = WeakReference::obtain(this);
}
TrueTypeRasterizer::~TrueTypeRasterizer()
{
ref->destroy();
ref->release();
FT_Done_Face(face);
data->release();
}
@@ -116,4 +121,4 @@ namespace freetype
} // freetype
} // font
} // love
} // love
@@ -24,6 +24,7 @@
// LOVE
#include <filesystem/File.h>
#include <font/Rasterizer.h>
#include <common/WeakReference.h>
// TrueType2
#include <ft2build.h>
@@ -51,6 +52,8 @@ namespace freetype
// File data
Data * data;
WeakReference * ref;
public:
TrueTypeRasterizer(FT_Library library, Data * data, int size);
@@ -67,4 +70,4 @@ namespace freetype
} // font
} // love
#endif // LOVE_FONT_FREETYPE_TRUE_TYPE_RASTERIZER_H
#endif // LOVE_FONT_FREETYPE_TRUE_TYPE_RASTERIZER_H
+1 -1
View File
@@ -49,7 +49,7 @@ namespace freetype
int size = luaL_checkint(L, 2);
t = instance->newRasterizer(d, size);
}
luax_newtype(L, "Rasterizer", FONT_RASTERIZER_T, t);
return 1;
}