Font Issues

Display of font error
In an older project I used the standard fonts. They are also displayed in the editor. But not in the browser. What should I do?
Beste GrĂĽĂźe Matthias

Failed to generate font files for Arial
UnityEngine.Debug:LogError (object)
Needle.Engine.Utils.FontsHelper/<RunCommand>d__12:MoveNext () (at ./Library/PackageCache/com.needle.engine-exporter@4.1.0-beta.2/Core/Editor/Utils/FontsHelper.cs:353)
UnityEngine.UnitySynchronizationContext:ExecuteTasks ()

Failed to generate font files for Jost-Medium
UnityEngine.Debug:LogError (object)
Needle.Engine.Utils.FontsHelper/<RunCommand>d__12:MoveNext () (at ./Library/PackageCache/com.needle.engine-exporter@4.1.0-beta.2/Core/Editor/Utils/FontsHelper.cs:353)
UnityEngine.UnitySynchronizationContext:ExecuteTasks ()

Failed to generate font files for Arial
UnityEngine.Debug:LogError (object)
Needle.Engine.Utils.FontsHelper/<RunCommand>d__12:MoveNext () (at ./Library/PackageCache/com.needle.engine-exporter@4.1.0-beta.2/Core/Editor/Utils/FontsHelper.cs:353)
UnityEngine.UnitySynchronizationContext:ExecuteTasks ()

Hi Matthias,

It looks like you’re encountering font generation issues in your Needle Engine project when transitioning to the browser. The error messages indicate that the font files for “Arial” and “Jost-Medium” are failing to generate. Here are a few steps you can take to troubleshoot and resolve the issue:

  1. Check Font Availability: Ensure that the fonts you’re trying to use are available in the project and properly imported. If you’re using custom fonts, verify that they are included in your project directory.

  2. Font Settings in Unity: Verify your font settings within Unity. Go to the font assets in your project, right-click on them, and check whether the settings are properly configured for web export.

  3. Regenerate Fonts: Try regenerating the font assets. You can do this by selecting the font files and using the option to regenerate them or regenerate the font sources if applicable.

  4. Check Console for Errors: Look into the Unity console for any additional errors or warnings that may provide more context on why the font generation is failing.

  5. Log Output: Review the logs for more details or any other hidden warnings/errors that may be present. You may also use the menu item “Help/Needle/Logs” to gather comprehensive logs for analysis.

  6. Update Packages: Ensure that you are using the latest version of Needle Engine and its related packages. Compatibility issues may arise from outdated versions.

If the issue persists, it could be beneficial to know the versions of Unity and Needle Engine you are using. You can find this information via the menu item “Copy Project Info Into Clipboard” and paste it here for further assistance.

Best,
Matthias

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

Hi Matthias,

which Unity + Nodejs + Needle Engine version are you using?

Unitity: 2023.3.22f1


image

Do you see any error in the Unity log when exporting (above the “Failed to generate font” ? they might not be printed as errors)

No, I don’t see any errors here


Could you send a bugreport?

Successfully submitted bug report

Somehow your bugreport contained Unity editor logs from yesterday and none from today. Could you try reproducing the error above and then submitting a bugreport again? Thank you

Thanks for the second upload.

  1. Could you check if this file exists and if so send it via DM? It’s not in the bugreport. C:\Users\matbean\AppData\Local\npm-cache\_logs\2025-01-30T16_58_59_287Z-debug-0.log (the npm log folder is sent with the bugreport but this file doesnt exist it seems)

  2. Could you try to save the scene with just a canvas and text component if that also reproduces the error? If it fails could you upload a new bugreport with that scene?

  3. After that report has been uploaded could you try running the following command from your commandline and let me know what it outputs?

npx --yes @needle-tools/helper@1.11.2 generate-font-atlas --fontPath "D:\2_Unity\45_MuseumDemos\MuseumDemosZittau\MuseumDemos\Library\PackageCache\com.needle.engine-samples@0.20.0-exp.1\Runtime\UI\Fonts\Jost-Medium.ttf" --targetDirectory "Library/Needle/FontCache~/7e618c6665f6cc6f937a0dd967b9f8fd-93368bbf265368ca7faca3e180c06203" --charset "D:/2_Unity/45_MuseumDemos/MuseumDemosZittau/MuseumDemos/Assets/../Library/Needle/FontCharsets~/Jost-Medium-93368bbf265368ca7faca3e180c06203-charset.txt"

Thank you.

Hello Marcel,
the file you are looking for does not exist

  1. I will test

zu 3. Der Befehl “helper” ist entweder falsch geschrieben oder
konnte nicht gefunden werden.

I saw this in the bugreport as well - can you try running npx --version and let me know which version you’re on?

Also npx --yes @needle-tools/helper@1.11.2 and send me your output?

It sounds like it’s somehow misinterpreting the npx command (@needle-tools/helper is the package on npm)

Hello Marcel,
The fonts are not yet visible.
After all my NPM/Node updates, I carried out your command again. That gave me the console back:

C:\Users\matbean>npx --yes @needle-tools/helper@1.11.2
Der Befehl “helper” ist entweder falsch geschrieben oder
konnte nicht gefunden werden

image

Hello Matthias, do you know if something else could be configured differently on this machine vs your others? E.g. the package exists on npm and this is aregular npx command (as sent above).

Could you try running it without --yes ?

Could you also try running npx @gltf-transform/cli for testing ?

The issue was caused by a corrupted npx cache.

Deleting C:\Users\<username>\AppData\Local\npm-cache\_npx resolved the issue.