From 86d6d46770550185d10251e99fb2c4f69bdbfb70 Mon Sep 17 00:00:00 2001 From: frankyifei Date: Thu, 22 Oct 2015 23:49:34 +1030 Subject: [PATCH] add isKindle check --- frontend/ui/font.lua | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/frontend/ui/font.lua b/frontend/ui/font.lua index d74f24b84..4553e6d3b 100644 --- a/frontend/ui/font.lua +++ b/frontend/ui/font.lua @@ -83,23 +83,25 @@ function Font:getFace(font, size) end function checkfont(f) - local exclusive_system_font = { - --these kindle system fonts can not be used by freetype and will give error - "HYGothicBold.ttf", - "HYGothicMedium.ttf", - "HYMyeongJoBold.ttf", - "HYMyeongJoMedium.ttf", - "MYingHeiTBold.ttf", - "MYingHeiTMedium.ttf", - "SongTBold.ttf", - "SongTMedium.ttf" - } - for _,value in ipairs(exclusive_system_font) do - if value == f then - return true + if Device:isKindle() then + local exclusive_system_font = { + --these kindle system fonts can not be used by freetype and will give error + "HYGothicBold.ttf", + "HYGothicMedium.ttf", + "HYMyeongJoBold.ttf", + "HYMyeongJoMedium.ttf", + "MYingHeiTBold.ttf", + "MYingHeiTMedium.ttf", + "SongTBold.ttf", + "SongTMedium.ttf" + } + for _,value in ipairs(exclusive_system_font) do + if value == f then + return true + end end + else return false end - return false end function Font:_readList(target, dir)