Hello all,
I have a simple question, why is it when I run the following piece of code in main.lua, the japanese text in the .txt file does not display properly (the text is displayed as boxes) and how do I fix this?
love.graphics.setFont(love.graphics.newFont'NotoMono.ttf')
local text = love.filesystem.read'japanese.txt'
function love.draw()
love.graphics.print(text,0,0)
end
I am using Google's NotoMono font, which does support japanese text.
As you can guess, my larger question is how to display in the love window any string of Unicode text that a font supports.
Last edited by SirDust on Tue Sep 05, 2017 7:52 am, edited 1 time in total.
You need a font that contains relevant characters. Either your font doesn't have kana or kanji characters or your text isn't japanese (and your font is missing those characters anyway).
I've lifted a random kanji font from the internet and tested it with a phrase in japanese i lifted from the same page, and it worked.
Whoops, I didn't realize that the version of the font I was using didn't support Japanese text, now that I found the Japanese version, it's working fine now. Thanks.