Questions: about menu and fonts fuzzy

Hello everybody!

I’m learning to use JUCE, and there are a lot of problems, ask for help.

1, How to add the main menu and toolbar? and make them can do something…
2, Text in window is too large, it seems a little fuzzy. How to cancel font’s shadows and smoothing?
3, I want to develop a program similar to Guitar Pro and Finale, how should I do?

Jules told me that the best way to learn is to start Programming, but I studied hard for many days, still do not know where to start. I am now just able to write a simple window, and add a few buttons, labels, Slider… can use component listener and message processing do simple processing, click the button to change the label text, ect. All of other don’t know how to do…


For menu setup, read the class documentation and have a look at how it’s done in the jucer and juce demo - it’s actually one of the more complicated bits of the library, and really isn’t something I can explain in a brief way - ask more specific questions if you need more help.

Search for font aliasing on the forum and you’ll find more about that.

That’s like saying “I’d like to build a car, can someone tell me how to do it?”… Far too big a question. Start with small things and work your way up.

Thank you, Jules.

Thank you, Jules.

A small request: if add some code of examples for each class in API documentation , that’s will very great . such as PopMenu class description…

I think you need assistants or secretary, to add and improve the API documentation, writing tutorials, promotion and publicity, etc. if programmers of more countries to use JUCE unobstructed, multi-language version of the documentation is required. Volunteer plan may be a better idea. but the heavy workload, hope more people get involved and need you help and aegis…I‘m willing to do my best, but my technique may not be enough. I’m so ashamed.

In addition, JUCE character support for the Far East is indeed a trouble, by default, use the L"…" can’t displayed yet, need to modify the font attributes in juce’s font cpp file. Using the VS, the standard C++, MFC, etc., can directly enter the Chinese, Japanese and displayed them no problem, TextEditor can also directly input and display Chinese, Japanese… but by default, JUCE can’t. and the default font of JUCE’s program is a bit vague.

I know your work is very busy, my requirements and issue may be too much. Please forgive me.

Couldn’t agree more!

It does definitely support unicode characters, as long as the layout is left-to-right. If it’s not working for you, it’s probably because your compiler settings are causing a mismatch between the character set of your cpp files and that of the compiler. There are other posts about this on the forum if you search.

My English is very poor, in order to avoid not clear, I use Chinese say again:


    在下有个不情之请:能否为JUCE API文档中的类描述中添加一些必须的示例和重要提醒?类似PopupMenu类的描述,这个类的描述里有示例代码,我看了一遍,就顺利制作出了弹出式菜单。而很多重要的类,都没有示例,研究的头大如斗,也不知所以然。面对JUCE,经常感到老虎吃天,无从下口。






Personally, I found your english slightly clearer than the chinese version!

Not, Jules, my compiler settings no problem. Not the reason because compiler. I use VS and MFC, no this problem. I know JUCE support Unicode, but the Chinese can not be displayed by default.

I have done a search, but didn’t find a good solution, maybe my bad luck, and I continue to search for it …

:stuck_out_tongue: Now you know, a multi-language document how important it is …

However, JUCE still very progressive. the JUCE-Demo in 1.51 version , the font interface, choice of any font, do not display Chinese, version 1.52 can show. :wink: But the choice of non-Chinese Font, still not display Chinese …Microsoft Office Word, etc., can do it this case…

I’ll take a stab at this… Are you asking about a “Fallback” font… a secondary font that Juce can use if the glyph/character isn’t in the current font?

Have you tried (in your initialise code)…

Font::setDefaultSansSerifTypefaceName(T(“Arial Unicode MS”))


There is another Chinese user on the list - DavidFeng who may be able to help…

Ah, thanks Justin, I’d forgotten about the whole fallback font thing.





以JUCE Demo示例程序为例,我抓两幅图诸位看一下。设置中文字体就可以显示,设置为英文字体,汉字就被吃掉了。在Office WORD中,就不是这样,英文可以显示为设置的英文字体,而汉字默认是宋体,二者同时显示。如果我要开发一个文本编辑程序,这种最常规的功能,我不知道如何用JUCE做出来?




helloWorldLabel->setFont (Font (T(“宋体”), 40.0000f, Font::bold));

text = new TextEditor(T(“Editor”)); // 创建并初始化TextEditor对象text
addAndMakeVisible(text); // 添加并显示
text->setMultiLine(true); // 设置多行,不设置默认是单行
text->setReturnKeyStartsNewLine(true); // 设置回车换行,不设置则不能换行

thisFont = new Font; // 实例化字体对象thisFont
thisFont->setTypefaceName(T(“华文细黑”)); // 设置字体对象的字体名称
thisFont->setHeight(20); // 设置字体大小
text->setFont(*thisFont); // 设置文本编辑对象的字体

void Font::getPlatformDefaultFontNames (String& defaultSans, String& defaultSerif, String& defaultFixed)
if (juce_IsRunningInWine())
// If we’re running in Wine, then use fonts that might be available on Linux…
defaultSans = “Bitstream Vera Sans”;
defaultSerif = “Bitstream Vera Serif”;
defaultFixed = “Bitstream Vera Sans Mono”;
// defaultSans = “Verdana”;
defaultSans = “宋体”; // 修改此处!
defaultSerif = “Times”;
defaultFixed = “Lucida Console”;

Google translate :slight_smile:

Thank you, Justin and Jules!

I think you have misunderstood my point. Alas, poor English is really struggling, with too much jargon of computer programming, how do I can not say clearly.

I am not saying Juce does not support the Far East characters. In fact, by adding some statements to set the font, or modify the Juce source code files (juce_win32_Fonts.cpp), I can display and input Chinese characters. However, this is not my point. I mean, why Juce not the same as the VS and the MFC, etc., without any of the settings can be directly input and display Chinese. For example, I now posted in Chinese, do not set any fonts, input on the display - so much convenience!

Jules said the Font class’s static function setFallbackFontName () I am concerned too, but no matter where the statement added, without the slightest change. Added to the main class of the initialise () function, not OK.

To JUCE Demo sample application, for example, I caught a look at two pictures of you. Set the font to display Chinese, the font is set to English, Chinese characters to be eaten. In the Office WORD, it is not so set in English English can be displayed as the font, the default is Times New Roman characters, the two displayed simultaneously. If I want to develop a text editor program, this most routine functions, I do not know how to do it with JUCE?

In addition, Juce display text, indeed fuzzy, looks very uncomfortable. Jules let me search, I found a whole day and have read many posts, still can not solve … …[/quote]

I have to attack Japanese pretty soon(text input) on the windows platform, if I run into any issues as a native English speaker I might be able to articulate them here…

SwingCoder can you internet search for WM_IME_COMPOSITION (hopefully it comes up in native tongue), there is also

I think these are the functions you are requesting(Jules added them for Mac, where multi-byte characters can be inputted), but I think something like this is still missing on Windows.

I’ll not touch the “fuzzy” text comment!

I have no idea what on earth that all means, but I noticed this line:

which looks very dodgy, because you’ve put some unicode characters inside an 8-bit string literal.

Google translation to do a good job :wink:

L “…” I forget it?




jules,U are a great man.I mean it…I think all Programmers
in China who making music software are in this Forum now…