TabComponent Messy code in win10?


#1

I have a program using Chinese and one component made by TabComponent, in winxp it’s correct,but in win10,why messy code,other components such as buttons are ok.Someone has the same problem?
Thanks.


#2

Screenshot would help. Is it something easily seen or reproducible using the JuceDemo?


#3

just like this,in win10 the tabbutton caption can not be read.


#4

juce4.3 TabComponent doesn’t support Chinese very well,maybe nobody use juce4.3 in Chinese. No one can solve this!?


#5

I think that @loopfine is one of the users who dealt the most with asian / non-latin linguistic issues of JUCE.

My tag in this post will hopefully draw his attention, in the hope that he may be helpful for this particular case.


#6

Hi, @boltdog2017

I assume you’re talking about juce::TabbedComponent. just did some tests, haven’t found this issue. see below:

What Chinese font are you using?


#7

test code:

    addAndMakeVisible (tabs = new TabbedComponent (TabbedButtonBar::TabsAtTop));

    tabs->addTab (L"第1个卡标签", Colours::beige, new TextEditor (), true);
    tabs->addTab (L"第2个卡标签", Colours::pink, new TextEditor (), true);
    tabs->addTab (L"第3个卡标签", Colours::black, new TextEditor (), true);
    tabs->addTab (L"第4个卡标签", Colours::grey, new TextEditor (), true);

    tabs->setCurrentTabIndex (0);
    tabs->setTabBarDepth (30);

The font which I’m using is ‘Microsoft YaHei’.


#8

I The font which I’m using is ‘宋体’,‘黑体’ , in windows xp ,all components are ok,in win7 win10, TextButtons and TextEditors etc are ok, but the TabComponent display unnormal,it’s strange.
JUCE Version 3.2.0 I test no this problem.


#9

Very odd that it’d be different on different OSes, the win32 functions we use should be exactly the same.


#10

On windows 10, You’ll have to disable ‘DirectWrite’ in Projucer’s settings, otherwise, there’s no way to display the Chinese font correctly or various strange things will appear in JUCE. Also, you need set the type face name suitably, or don’t set it at all (this’ll be ok when enabled DirectWrite. in this case, JUCE will use the OS default font ‘Microsoft YaHei’ if your OS is Chinese version.).

宋体:

楷体:


#11

I compile program in windows xp by VS2010 no ‘DirectWrie’, run in xp,win7,win10. I guess maybe I should compile the program in win7 or win10?


#12

It’s not odd, Jules. At least, there’re a few differences on different Windows OS when you use non-ascii font. Chinese for example…


#13

ok guys,maybe I find the reason,
in LookAndFeel_V3::drawTabButton
textLayout.draw (g, Rectangle (length, depth));

If I use g.drawText directly it’s ok,the textLayout(juce4.3) draw Chinese not good.


#14

This problem still exist in JUCE 5.
I test TabComponet in win10, if I set font as Chinese,messy code.
Expect solve it,thanks.