Russian characters issue


#1

Hi!
How to resolve a problem with russian characters?
For example I want something like
TextButton* installButton = new TextButton(“Установить”);
But I get incorrect, unreadable characters on the button.

My system is - Win7 64 english. Other localized programs display correctly.

Thanks!


#2

I think the font you are using doesn’t have Russian glyphs present. There is no font fallback with standard text rendering so if the font you chose doesn’t have the glyphs you’ll just get boxes.

You have two choices:

  1. Switch to a font that has Russian glyphs. “Arial Unicode MS” will definitely contain it.
  2. Render your text using TextLayout/AttributedString classes. This will let you use complex text rendering which does have font fallback support.

#3

switching a font didn’t help

Font f(String("Arial Unicode MS"), 20,1 ); g.setFont(f); g.drawText("Привет", 6, 15, getWidth(), 10, juce::Justification::left, 2);
Can you show me please how to use TextLayout/AttributedString with labels, buttons?


#4

Never attempt to embed extended characters directly in a C++ string literal!

The introjucer has a UTF-8 generation tool that will create a cross-platform string literal that you can safely put in your code.