I’m displaying a block of text in a small component. The text is long enough that it has to be broken up into multiple lines. We’re using TextLayout.
Several languages are available including Japanese and Chinese. On Mac the multiline text appears correctly in all languages.
On Windows the text appears fine in all languages except Japanese/Chinese, in which it stays on a single line and goes out of bounds.
Here are some screenshots and our code
Mac
Windows
Rectangle<float> rect(zX(offset[3]), zY(offset[0]), getWidth() - zW(offset[1] + offset[3]), getHeight() - zH(offset[0] + offset[2]));
g.setColour(colour);
g.fillRoundedRectangle(rect, zW(3.0));
AttributedString s(text);
s.setFont(*font);
s.setLineSpacing(1.0);
s.setJustification((int)minimalHeight == singleLineHeight ? Justification::centred : Justification::centredLeft);
TextLayout t;
Rectangle<float> textRect = rect.withSizeKeepingCentre(rect.proportionOfWidth(0.9), rect.proportionOfHeight(0.9));
t.createLayout(s, textRect.getWidth());
t.draw(g, textRect);
Any idea why the Japanese/Chinese is behaving this way on Windows?