Fonts Are not showing in build

Hi i’m using creating a 3d+2d website using needle engine and unity. And i’m using fredoka font for text. And i’m using normal text component of unity for showing text. It is showing me the following error in unity console.

Hello Abdul Raheem,

It looks like you’re facing an issue where fonts are not showing in your Needle Engine build while using the Fredoka font in Unity. Based on the context you’ve provided, it’s essential to ensure that the font is properly exported and integrated with your project.

Here’s how you can troubleshoot the font issue:

  1. Check Font Import Settings:

    • Make sure the Fredoka font is imported correctly into Unity.
    • Open the font asset and check its settings, ensuring that it is set up for dynamic text if necessary.
  2. Generate Font Atlas:

    • You may need to force the generation of the font atlas for your font asset. You can do this by navigating to the code that manages font generation in your project. The key method seems to involve GenerateFonts which creates the font atlas based on your specified font (see the documentation) (see the documentation).
  3. Console Warnings:

    • Check the Unity Console for any warnings regarding font paths. If you see warnings about missing font files or paths, it could indicate that the font is not included in your build due to export configuration issues (see faq) (see the documentation).
  4. Ensure Characters are Included:

    • Make sure that the character set includes all the characters you plan to use in your text. You can modify the charset in the relevant script if needed, to include the default ASCII characters along with others specific to your application (see the documentation) (see the documentation).
  5. Check Build Settings:

    • Ensure that your export settings in Unity are configured to include the necessary assets and that your font isn’t being excluded during the build process.
  6. Update and Restart:

    • If the issue persists, consider updating Needle Engine to the latest version, stopping the local dev server, and restarting it as sometimes cached data may cause issues (see faq).

If you still face issues after these steps, please provide any specific error messages from the console that may help further diagnose the problem.

Feel free to reach out with more details if necessary!

1 replies left - Get a PRO license for more AI replies.
thread_xWgIzvItRhC0113qbPVd4RwK
Reply to this message to continue the conversation

@marcel can you please help me this problem?

Hi, does this also reproduce in a new minimal scene in a canvas and Your fonts? If yes could you send a bugreport with the minimal scene (via the needle engine menu item)

Ok let me check and if it occurs i send a bug report

@marcel the error is still there so i’ve sent a bug report

Thanks, we received it. We’ll take a look as soon as possible

Hello, I’ve just ran your project locally here and the fonts were generated successfully.

Looking at your provided log files it seems like that some npm caches are corrupted and the error appears directly before the failed fonts error so I believe this is causing the problem on your side.

Could you try completely deleting the following directory C:\Users\User\AppData\Local\npm-cache\_npx and then trying to export your project again? After that the cache should (hopefully) correctly fix itself and generate the missing files.

@marcel I’ve followed the instructions but I’m still facing the same issue it is not generating any font file. These are the errors that occurs in unity console when we install the project.

@marcel i try running it in another system and fonts were successfully generated the problem lies in my system can you suggest any fix for this problem

Can you check the Unity log and see if it also contains an error with the npx filepath as above?

@marcel it is giving this error in generating font file

Error: Cannot find package ‘C:\Users\User\AppData\Local\npm-cache_npx\390d83e2c2518b2f\node_modules\basic-ftp\package.json’ imported from C:\Users\User\AppData\Local\npm-cache_npx\390d83e2c2518b2f\node_modules@needle-tools\helper\dist\actions\upload-to-ftp.js

This is the same package missing as before. You deleted the npx cache before trying again? Could you try closing Unity before deleting the caches?

Additionally it might be worth trying to run npm cache verify although this never helped me previously with this type of error, but it’s worth a shot

@marcel yes I’ve try deleting npx cache and then open the unity but still same problem

Have you tried running npm cache verify ?

Yes i try running it but found no problem there.