mirror of
https://github.com/love2d/love.git
synced 2026-08-20 12:40:20 +02:00
made truetype fonts use luminance-alpha format for their data instead of rgba (thus halving their memory requirements)
This commit is contained in:
@@ -87,7 +87,7 @@ namespace freetype
|
|||||||
glyphMetrics.width = bitmap.width;
|
glyphMetrics.width = bitmap.width;
|
||||||
glyphMetrics.advance = face->glyph->metrics.horiAdvance >> 6;
|
glyphMetrics.advance = face->glyph->metrics.horiAdvance >> 6;
|
||||||
|
|
||||||
GlyphData * glyphData = new GlyphData(glyph, glyphMetrics, GlyphData::FORMAT_RGBA);
|
GlyphData * glyphData = new GlyphData(glyph, glyphMetrics, GlyphData::FORMAT_LUMINANCE_ALPHA);
|
||||||
|
|
||||||
{
|
{
|
||||||
int size = bitmap.rows*bitmap.width;
|
int size = bitmap.rows*bitmap.width;
|
||||||
@@ -97,8 +97,8 @@ namespace freetype
|
|||||||
// our luminosity-alpha format.
|
// our luminosity-alpha format.
|
||||||
for(int i = 0; i<size; i++)
|
for(int i = 0; i<size; i++)
|
||||||
{
|
{
|
||||||
dst[4*i] = dst[4*i+1] = dst[4*i+2] = 255;
|
dst[2*i] = 255;
|
||||||
dst[4*i+3] = bitmap.buffer[i];
|
dst[2*i+1] = bitmap.buffer[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user