Hi, the project uses Unity legacy text with Roboto-Medium as its font. The MSDF generated for it misses some characters from the Chinese and Japanese languages. So my question is, the way to handle this is by generating the MSDF using other fonts that include those characters and replacing the MSDF with the generated one?
Even if I do it like that, won’t it be replaced when I click full export?
Thanks.
installHook.js:1 The character ‘ネ’ is not included in the font characters set.
installHook.js:1 The character ‘ジ’ is not included in the font characters set.
installHook.js:1 The character ‘を’ is not included in the font characters set.
installHook.js:1 The character ‘緩’ is not included in the font characters set.
installHook.js:1 The character ‘め’ is not included in the font characters set.
installHook.js:1 The character ‘る’ is not included in the font characters set.
installHook.js:1 The character ‘侧’ is not included in the font characters set.
installHook.js:1 The character ‘盖’ is not included in the font characters set.
Hi Ashok,
Thank you for reaching out with your question. It seems like you’re encountering issues with certain characters (specifically Chinese and Japanese characters) being missing from the MSDF (Multisampled Anti-Aliased Textures for Glyphs) generated by the Roboto-Medium font in your Unity project.
Here are some steps and considerations that might help you resolve this issue:
1. Confirm the Font Supports the Characters
Ensure that the Roboto-Medium font actually supports the characters you need (Chinese and Japanese). You can do this by:
- Inspecting the font file to see if it contains the characters.
- Using a Unicode character checker to verify the font’s character range.
2. Generate MSDF with a Font that Supports the Characters
If Roboto-Medium does not support all the required characters, you can generate MSDF using a different font that does. You can follow these steps:
- Change the font to a different one that supports those characters (e.g., a Chinese or Japanese font).
- Regenerate the MSDF textures in Unity.
- Export the project and check if the characters are now present.
3. Verify the Export Process
When you click on “Full Export,” certain resources might get replaced depending on your settings. You can check the following:
- Confirm that the font asset is included in the export process.
- Verify that the MSDF textures are not being overridden during the export.
4. Customize the Export Process (if necessary)
If the font and MSDF textures are not being included in the export, you might need to customize the export process. You can do this by:
- Using the
syncInstantiate options to manage your text assets.
- Referencing your custom font and MSDF textures via
AssetReference or Addressables.
5. Use the Needle Engine Documentation for Further Guidance
The Needle Engine documentation provides some guidance on handling asset references and export processes. You can refer to the following sections:
6. Ask for Clarification
To better assist you, could you provide more information about the following?
- The exact version of Needle Engine and Unity you are using.
- The steps you are taking to export the project.
- Any custom settings or scripts that might be affecting the export process.
7. Provide a Solution
If you decide to proceed with generating MSDF using a different font, you can do the following:
- Download a font that includes the Chinese and Japanese characters you need.
- Replace the
Roboto-Medium font in your Unity project with the new font.
- Generate the MSDF textures for the new font.
- Export the project and verify if the characters are now present.
8. Contact the Community or Support
If you continue to face issues, consider reaching out to the Needle Engine community or support team for further assistance.
Let me know if you have any other specific questions or need more detailed guidance on any of the above steps.
Best regards,
Qwen
Sources: Needle Engine Docs (53%)
4 replies left
Reply to this post directly if you need further help (bottom right button)
Hello,
by default all characters that are used in your scene/project at export time are used for generating the MSDF.
You can add additional fonts by either adding the FontAdditionalCharacters component to your scene and adding any other characters to its list that you want to include in the MSDF (or you can implement the IAdditionalFontCharacters interface in your code and return extra characters in the GetAdditionalCharacters() function).
Or using fallbacks (switching to a font that has this charcters) is a better option? im using unity legacy text so cant simply add fallbacks like with tmp
Hey sorry missed the reply. Will try and let u know
Hi, is there any documentation available regarding it?
I looked up and couldnt find any.
Your font needs to support the characters - if Roboto doesn’t support them you need to choose a different font.
As Marcel said, your font needs to support these languages. I can recommend Noto, which has basically everything (https://fonts.google.com/noto). You can get “Noto Universal” as single merged font from here for example: Releases · satbyy/go-noto-universal · GitHub.
TL;DR: If you want to be able to basically use any character you specify, use a “Noto Universal” font like https://github.com/satbyy/go-noto-universal/releases/download/v7.0/GoNotoKurrent-Regular.ttf in Unity and let the characters be generated from that.