# Japanese text display

**URL:** <https://forum.juce.com/t/japanese-text-display/3445>\
**Category:** Windows\
**Created:** [December 16, 2008, 12:04pm UTC](https://forum.juce.com/t/japanese-text-display/3445 "2008-12-16T12:04:09Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![otristan](https://avatars.discourse-cdn.com/v4/letter/o/f0a364/32.png) [@otristan](https://forum.juce.com/u/otristan)\
**Post date:** [December 16, 2008, 12:04pm UTC](https://forum.juce.com/t/japanese-text-display/3445/1 "2008-12-16T12:04:09Z")

</div>

Hi Guys,

I’m trying to display some Japanese text and I have some trouble.  
It works fine on mac though. (specifying a japanese font like Hiragino Kaku Gothic Pro W6)

I would like to know if there are some special stuff to do on Windows to make it work ?

Thanks,

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [December 16, 2008, 1:23pm UTC](https://forum.juce.com/t/japanese-text-display/3445/2 "2008-12-16T13:23:08Z")

</div>

Should work ok if your system has a japanese font installed… I know that people are using juce for apps that handle japanese, so it’s certainly possible!

---

<div class="post-metadata">

**Author:** ![otristan](https://avatars.discourse-cdn.com/v4/letter/o/f0a364/32.png) [@otristan](https://forum.juce.com/u/otristan)\
**Post date:** [December 16, 2008, 1:41pm UTC](https://forum.juce.com/t/japanese-text-display/3445/3 "2008-12-16T13:41:51Z")

</div>

Japanese fonts are installed ( I try to make it work in other app just before)  
and it display fine in Visual C++, firefox…

Juce is compiled with Unicode support.

When trying to display a Japanese char, I end up here in juce\_Typeface.cpp

[code]  
else if (character != defaultCharacter)  
{  
const Font fallbackFont (Font::getFallbackFontName(), 10, 0);  
Typeface\* const fallbackTypeface = fallbackFont.getTypeface();

```
    if (fallbackTypeface != 0 && fallbackTypeface != this)
        return fallbackTypeface->getGlyph (character);

    return getGlyph (defaultCharacter);
}[/code]

```

Font::getFallbackFontName() returns en empty string.  
Don’t know if this looks good.  
and at the end it ended up returning 0 as TypefaceGlyphInfo

Any idea ?

---

<div class="post-metadata">

**Author:** ![otristan](https://avatars.discourse-cdn.com/v4/letter/o/f0a364/32.png) [@otristan](https://forum.juce.com/u/otristan)\
**Post date:** [December 16, 2008, 2:00pm UTC](https://forum.juce.com/t/japanese-text-display/3445/4 "2008-12-16T14:00:23Z")

</div>

If I specify MS Mincho as fonts it now works fine on Windows.  
So it looks like the real issue is the value that returns getFallbackFontName

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [December 16, 2008, 2:26pm UTC](https://forum.juce.com/t/japanese-text-display/3445/5 "2008-12-16T14:26:56Z")

</div>

Oh yes - sorry, I’d forgotten all about the setFallbackFontName() stuff. Yes, if you call that to set something sensible, it should work.

---

<div class="post-metadata">

**Author:** ![auspuff](https://avatars.discourse-cdn.com/v4/letter/a/bc79bd/32.png) [@auspuff](https://forum.juce.com/u/auspuff)\
**Post date:** [January 26, 2009, 4:13pm UTC](https://forum.juce.com/t/japanese-text-display/3445/6 "2009-01-26T16:13:19Z")

</div>

We use Font::setFallbackFontName(“MS UI Gothic”); on the PC and it works just fine but setFallbackFontName does not work on the Mac.

Does not work:  
Font::setFallbackFontName(“Osaka”);

But this does work fine:  
Font::setDefaultSansSerifFontName(“Osaka”);

I have also tried with MS Arial Unicode but with the same reslt.

So it’s possible to set and display the Japanese glyphs on the Mac but not as a fallback font?

---

<div class="post-metadata">

**Author:** ![jaydee](https://avatars.discourse-cdn.com/v4/letter/j/ee7513/32.png) [@jaydee](https://forum.juce.com/u/jaydee)\
**Post date:** [January 26, 2009, 5:55pm UTC](https://forum.juce.com/t/japanese-text-display/3445/7 "2009-01-26T17:55:32Z")

</div>

+1 for fallback font not working on the mac(using tip) and Listbox

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [January 27, 2009, 2:58pm UTC](https://forum.juce.com/t/japanese-text-display/3445/8 "2009-01-27T14:58:57Z")

</div>

Ok, I’ll investigate…

---

<div class="post-metadata">

**Author:** ![jaydee](https://avatars.discourse-cdn.com/v4/letter/j/ee7513/32.png) [@jaydee](https://forum.juce.com/u/jaydee)\
**Post date:** [January 27, 2009, 3:02pm UTC](https://forum.juce.com/t/japanese-text-display/3445/9 "2009-01-27T15:02:44Z")

</div>

ã

---

<div class="post-metadata">

**Author:** ![auspuff](https://avatars.discourse-cdn.com/v4/letter/a/bc79bd/32.png) [@auspuff](https://forum.juce.com/u/auspuff)\
**Post date:** [January 27, 2009, 4:41pm UTC](https://forum.juce.com/t/japanese-text-display/3445/10 "2009-01-27T16:41:21Z")

</div>

^ yes, what he said 😉

---

<div class="post-metadata">

**Author:** ![jaydee](https://avatars.discourse-cdn.com/v4/letter/j/ee7513/32.png) [@jaydee](https://forum.juce.com/u/jaydee)\
**Post date:** [February 10, 2009, 8:19pm UTC](https://forum.juce.com/t/japanese-text-display/3445/11 "2009-02-10T20:19:54Z")

</div>

Just a note that the setFallbackFont is working on the Mac now with revision 689
