implement GUI dialog for setting crengine fallback font

This commit is contained in:
frankyifei
2015-09-03 00:51:38 +09:30
parent 835b0ec927
commit 059de23037
3 changed files with 149 additions and 8 deletions

View File

@@ -75,10 +75,13 @@ function RenderText:getGlyph(face, charcode, bold)
for index, font in pairs(Font.fallbacks) do
-- use original size before scaling by screen DPI
local fb_face = Font:getFace(font, face.orig_size)
if fb_face.ftface:checkGlyph(charcode) ~= 0 then
rendered_glyph = fb_face.ftface:renderGlyph(charcode, bold)
--DEBUG("fallback to font", font)
break
if fb_face ~= nil then
-- for some characters it cannot find in Fallbacks, it will crash here
if fb_face.ftface:checkGlyph(charcode) ~= 0 then
rendered_glyph = fb_face.ftface:renderGlyph(charcode, bold)
--DEBUG("fallback to font", font)
break
end
end
end
end