You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expected: App should launch. Actual:Fatal error: exception Fontkit.FontKitLoadFaceException("[ERROR]: Unable to load font at FT_New_Face\n")
The issue is that when we load fonts, or assets like images, we load them from the current working directory. This is problematic, because the user should be able to launch the executable from anywhere.
Because of this limitation - we have to include this awkward instruction in our README.md:
After you build, the executables will be available in the _build\install\default\bin folder.
NOTE: Currently the executables must be run from install\default\bin, since the assets are there.
However, the user should just be able to run via esy x Bin.exe to try out the example app.
Streamlining this would make the first-run experience much smoother, and also unblock #136 .
let getExecutingDirectory = () => {
Filename.dirname(Sys.argv[0]);
};
Update our font loading and asset loading path to use the executingDirectory instead of the current working directory. We'd probably want to handle this in our TextNode and ImageNode classes, or we could handle it lower in the stack (ImageRenderer, FontCache). Append the executing directory + requested asset.
Considerations:
We need to make sure this works fine in the JS strategy, too! I think all the logic should be the same if getExecutingDirectory simply returns / (the root) in the JSOO environment.
In the future, we might want to make our asset loading more flexible - some scenarios we'll potentially need to address:
Looking for font files in the system font directory
Allow custom paths (perhaps an app wants to put all its assets in a different place)
The text was updated successfully, but these errors were encountered:
REPRO:
esy x Bin.exe
Expected: App should launch.
Actual:
Fatal error: exception Fontkit.FontKitLoadFaceException("[ERROR]: Unable to load font at FT_New_Face\n")
The issue is that when we load fonts, or assets like images, we load them from the current working directory. This is problematic, because the user should be able to launch the executable from anywhere.
Because of this limitation - we have to include this awkward instruction in our
README.md
:However, the user should just be able to run via
esy x Bin.exe
to try out the example app.Streamlining this would make the first-run experience much smoother, and also unblock #136 .
Some things we need to do:
rench
: API - Environment: getWorkingDirectory & getExecutingDirectory rench#15 - but we could just port over the relevant code, too:TextNode
andImageNode
classes, or we could handle it lower in the stack (ImageRenderer
,FontCache
). Append the executing directory + requested asset.Considerations:
getExecutingDirectory
simply returns/
(the root) in the JSOO environment.In the future, we might want to make our asset loading more flexible - some scenarios we'll potentially need to address:
The text was updated successfully, but these errors were encountered: