Remove support for non-TTF fonts

This patch set removes support in TWRP for the old .dat file
format as well as support for the AOSP style fonts in header
files. We need TTF for scaling.

Note that the old AOSP style header font is still supported in
minui which is not used by TWRP.

Change-Id: I6124a3333d479f1fc668138f7e32c4be9b519552
This commit is contained in:
Ethan Yonker
2015-10-04 22:09:08 -05:00
parent 068c76888b
commit 88037f476f
41 changed files with 39 additions and 1589 deletions
+1 -26
View File
@@ -113,7 +113,6 @@ FontResource::FontResource(xml_node<>* node, ZipArchive* pZip)
file = attr->value();
#ifndef TW_DISABLE_TTF
if(file.size() >= 4 && file.compare(file.size()-4, 4, ".ttf") == 0)
{
m_type = TYPE_TTF;
@@ -141,28 +140,8 @@ FontResource::FontResource(xml_node<>* node, ZipArchive* pZip)
}
}
else
#endif
{
m_type = TYPE_TWRP;
if(file.size() >= 4 && file.compare(file.size()-4, 4, ".ttf") == 0)
{
attr = node->first_attribute("fallback");
if (!attr)
return;
file = attr->value();
}
if (ExtractResource(pZip, "fonts", file, ".dat", TMP_RESOURCE_NAME) == 0)
{
mFont = gr_loadFont(TMP_RESOURCE_NAME);
unlink(TMP_RESOURCE_NAME);
}
else
{
mFont = gr_loadFont(file.c_str());
}
LOGERR("Non-TTF fonts are no longer supported.\n");
}
}
@@ -170,12 +149,8 @@ FontResource::~FontResource()
{
if(mFont)
{
#ifndef TW_DISABLE_TTF
if(m_type == TYPE_TTF)
gr_ttf_freeFont(mFont);
else
#endif
gr_freeFont(mFont);
}
}