ToME: the Tales of Maj'Eyal

Everything about ToME
It is currently Wed Nov 21, 2018 7:47 am

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Sat Oct 27, 2018 8:30 pm 
Offline

Joined: Mon Nov 21, 2016 1:11 pm
Posts: 3
I'm making translation for ToME as addon, but I got a problem right now: most of default tome fonts have not some glyphs like cyrillic characters. Is there a way to add font pack to my addon or change default font files by overloading it?


Top
 Profile  
 
PostPosted: Sun Oct 28, 2018 8:46 am 
Offline

Joined: Mon Nov 21, 2016 1:11 pm
Posts: 3
So far i managed to load mine font in hooks:

Code:
local Base = require "engine.ui.Base"
--local FontPackage = require "engine.FontPackage"

class:bindHook("ToME:load", function(self, data)
--FontPackage:loadDefinition("/data/font/packages/default.lua")
Base.font = core.display.newFont("/data-rusificator/font/DroidSans.ttf", 12)
Base.font_h = Base.font:lineSkip()
Base.font_mono = core.display.newFont("/data-rusificator/font/DroidSansMono.ttf", 12)
Base.font_mono_w = Base.font_mono:size("  ") - Base.font_mono:size(" ")  -- account for inter-letter interval
Base.font_mono_h = Base.font_mono:lineSkip()
Base.font_bold = core.display.newFont("/data-rusificator/font/DroidSans.ttf", 12)
Base.font_bold_h = Base.font_bold:lineSkip()
end)


overriding font files did not work. overriding of fontPackage works partialy. new font pack appears in settings WHILE tome module loaded, but loading fonts from it did not works, engine falls to base fonts anyway.
If I set fonts like in code above I'm loosing font size control with settings. What can i do to fix that?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group