Can I set localized fonts differently?
Can I set localized fonts differently?
Currently, all national language fonts are used the same.
Can I set localized fonts differently?
English = A font
Chinese = B font
Korea = C font
Can I set localized fonts differently?
English = A font
Chinese = B font
Korea = C font
Re: Can I set localized fonts differently?
It's not built in, but it's an excellent idea. The Dialogue System uses Text Table assets for non-dialogue database text. I'll add a feature so that you can assign a font to each language defined in the Text Table. Dialogue UIs and LocalizeUI components (for non-dialogue text) will then be able to automatically check the Text Table and make sure they use the correct font for the current language.
If this feature doesn't get into version 2.2.5, I'll try to get it into 2.2.6.
In the meantime, you could write a short script to do it yourself. It might look something like this:
If this feature doesn't get into version 2.2.5, I'll try to get it into 2.2.6.
In the meantime, you could write a short script to do it yourself. It might look something like this:
Code: Select all
using UnityEngine;
using PixelCrushers.DialogueSystem;
// Add this to a GameObject with a UI Text component.
public class SetFontForLanguage : MonoBehaviour
{
public Font defaultFont; //<--ASSIGN IN INSPECTOR
public Font englishFont;
public font chineseFont;
public font koreanFont;
void OnEnable()
{
var text = GetComponent<UnityEngine.UI.Text>();
if (text == null) return;
if (Localization.language == "en") text.font = englishFont;
else if (Localization.language == "zh") text.font = chineseFont;
else if (Localization.language == "ko") text.font = koreanFont;
else text.font = defaultFont;
}
Re: Can I set localized fonts differently?
I don't need to buy another UI localize eset.
Thank you for creating such a nice set of etsets.
Thank you for creating such a nice set of etsets.
-
- Posts: 106
- Joined: Wed Aug 23, 2017 4:10 pm
- Location: Canada
Re: Can I set localized fonts differently?
Just to make sure, if you use TextMesh Pro, you can set a Fallback Font to any TMP font.
Let's say that by default, you use latin character and you display Japanese text, by default, it wont display properly. But by using the Fallback system, you can set a font that will be used in the case the character can't be found. It is really useful to support CKJ languages.
You can see more here:
(Sorry didn't want to hijack the thread).
Let's say that by default, you use latin character and you display Japanese text, by default, it wont display properly. But by using the Fallback system, you can set a font that will be used in the case the character can't be found. It is really useful to support CKJ languages.
You can see more here:
(Sorry didn't want to hijack the thread).
Unity 2022.3.17f1
Dialogue System 2.2.44.1
OpenAI Addon 1.0.12
Dialogue System 2.2.44.1
OpenAI Addon 1.0.12
Re: Can I set localized fonts differently?
That's a good point. Thanks for sharing!
I'll still plan to add localized font settings to the Dialogue System so you'll have total control over which font is used for each language. You could even use it for the same language but simply to offer different font choices. Some visual novels provide this nice feature nowadays. You can choose a more stylized font to match the atmosphere of the game, or a simpler font to make it more readable on smaller displays.
I'll still plan to add localized font settings to the Dialogue System so you'll have total control over which font is used for each language. You could even use it for the same language but simply to offer different font choices. Some visual novels provide this nice feature nowadays. You can choose a more stylized font to match the atmosphere of the game, or a simpler font to make it more readable on smaller displays.
-
- Posts: 1
- Joined: Fri Jun 25, 2021 5:37 pm
Re: Can I set localized fonts differently?
Thank you for creating such a nice set of etsets and i am glad you shate this information,
-
- Posts: 12
- Joined: Tue Feb 22, 2022 11:23 am
Re: Can I set localized fonts differently?
Hi Tony, does this feature exist now? Was looking through the documentation but can't find it. Thanks!Tony Li wrote: ↑Mon Jan 13, 2020 1:09 pm That's a good point. Thanks for sharing!
I'll still plan to add localized font settings to the Dialogue System so you'll have total control over which font is used for each language. You could even use it for the same language but simply to offer different font choices. Some visual novels provide this nice feature nowadays. You can choose a more stylized font to match the atmosphere of the game, or a simpler font to make it more readable on smaller displays.
Re: Can I set localized fonts differently?
Hi,
It's currently available as a patch on the Dialogue System Extras page (direct download) because the documentation on it isn't up yet.
Briefly:
1. Create a Localized Fonts asset (Assets > Create > Pixel Crushers > Common > UI > Localized Fonts). Set default fonts for Text and/or TextMesh Pro, and then add records for each language that has its own font.
2. Add a UILocalizationManager component to your Dialogue Manager if it doesn't already have one. Assign the Localized Fonts asset to it.
3. LocalizeUI components will set their fonts accordingly.
4. To tell Text and TextMeshProUGUI components in dialogue UIs, quest log windows, etc., to set their fonts, add SetLocalizedFont components to them.
It's currently available as a patch on the Dialogue System Extras page (direct download) because the documentation on it isn't up yet.
Briefly:
1. Create a Localized Fonts asset (Assets > Create > Pixel Crushers > Common > UI > Localized Fonts). Set default fonts for Text and/or TextMesh Pro, and then add records for each language that has its own font.
2. Add a UILocalizationManager component to your Dialogue Manager if it doesn't already have one. Assign the Localized Fonts asset to it.
3. LocalizeUI components will set their fonts accordingly.
4. To tell Text and TextMeshProUGUI components in dialogue UIs, quest log windows, etc., to set their fonts, add SetLocalizedFont components to them.
-
- Posts: 12
- Joined: Tue Feb 22, 2022 11:23 am
Re: Can I set localized fonts differently?
Thank you! I got that working. Is there a way to also set the font size differently per language? Maybe by modifying the LocalizedFonts script?
Re: Can I set localized fonts differently?
In the next full release, I can add font size to LocalizedFonts.
Should this be an absolute font size (e.g., 12-point font) or relative to the default font size (e.g., 1.2 * default font size)?
Should this be an absolute font size (e.g., 12-point font) or relative to the default font size (e.g., 1.2 * default font size)?