Love2d can't find font file in the same directory
<p>I'm using love2d 0.10.1. Love2d returns error that font file cannot be loaded as it doesn't exist. However the file is in a child directory. I tried giving full path with filename and it won't work. The font file <strong>has to be</strong> in another directory because in will not be included in the final exe.</p>

<p>My current directories look like this</p>

<pre><code>--- love 2d
------ game
---------- main.lua
---------- fonts
-------------- segoeui.ttf
------ love.exe
</code></pre>

<p>And will look like this when the final exe is made</p>

<pre><code>--- love 2d
------ fonts
---------- segoeui.ttf
------ game.exe
</code></pre>

<p>My code (simplified)</p>

<pre><code>love.window.setMode(500, 500)  -- Open window
font = love.graphics.newFont('segoeui.ttf', 20)  -- Load font
love.graphics.print(text, 100, 100)  -- Print text
love.graphics.present()  -- Display text
while true do end
</code></pre>

<p>Error message</p>

<p><a href="https://i.stack.imgur.com/umArv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/umArv.png" alt="enter image description here"></a></p>

<p>I found someone saying this is because love can't access folders outside main one so I tried this</p>

<pre><code>love.window.setMode(500, 500)  -- Open window
local file = io.open("fonts\\segoeui.ttf", "r")
local content = file:read "*a"
local data, err = love.filesystem.newFileData(content, 'segoeui.ttf')
font = love.graphics.newFont(data, 20)  -- Load font
love.graphics.print("hey", 100, 100)  -- Print text
love.graphics.present()  -- Display text
while true do end
</code></pre>

<p>This way io.open opens the file successfully, content is read then converted into a FileData and then fed to newFont. However this returns the error that font can't be loaded because data is incorrect. I guess it's not the way to load it.</p>