mirror of
https://github.com/love2d/love.git
synced 2026-08-15 07:41:11 +02:00
Improve compatibility check (I still can't believe robin was right)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user