Questions: about menu and fonts fuzzy


#1

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…

Thanks!


#2

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.


#3

Thank you, Jules.


#4

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.


#5

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.


#6

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

谢谢你,Jules!

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

我觉得您的当务之急可能更需要一个或几个优秀的助理或秘书,而不是埋头写代码,论坛做回复,这样效率很低,而且会影响您的正常工作。我发现论坛的很多帖子您都是亲自回复,不少问题都很白痴,这肯定会占用相当一部分精力,或者破坏心情。

一份全面而详尽的API文档,一部权威而优秀的JUCE教程,一些充分而独特的推广宣传,我认为也是您目前最需要的。为使更多国家的程序员能顺利、无障碍的使用JUCE,多国语言的资料和文档也是必须的。志愿者计划可能是个不错的主意。JUCE文档的工作量很大,衷心希望更多的人能齐心协力,众人拾柴。这当然离不开您的支持和指导...在下愿意尽我所能,但技术可能还不够。非常惭愧。但如果有需要,一定不遗余力。

此外,JUCE对远东字符的支持确实不够方便,默认情况下使用L"...."语法并不能正常显示中文、日文或韩文,需修改JUCE源码文件中的字体属性才行。而我使用微软的VS,其它IDE中使用标准C++,使用MFC等类库时,都没有这个问题。直接输入中文就行。文本编辑控件中,也可以直接输入并正常显示中文。很遗憾的是,JUCE在默认情况下,的确不行。而且,JUCE开发出来的程序,主界面中的文字的确模糊,略大,默认使用了阴影和平滑技术,我很不理解,为何要如此处理?

您的工作很忙,JUCE也是很出色的C++类库,我的要求和问题可能太过分了。也许因为我的技术还太菜,也许因为英语较差而词不达意。总之,请多多谅解。

再次感谢!

#7

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


#8

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 …


#9

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


#10

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…


#11

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…

http://www.rawmaterialsoftware.com/viewtopic.php?f=3&t=5533


#12

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


#13

谢谢Justin和Jules!

我想你们都误解我的意思了。唉,英语不好真是费劲,加上计算机编程专业术语太多,我怎么都无法说清楚。

我并不是说Juce不支持远东字符。事实上,通过添加一些设置字体的语句,或者修改Juce源代码文件(juce_win32_Fonts.cpp),我完全可以显示和输入中文。但是,这并不是我想说的。我的意思是,为什么Juce不能象VS和MFC等一样,无需任何设置就能直接输入和显示中文。就比如我现在用中文发帖,不用设置任何字体,输入就显示——这样多方便!

Jules说的Font类的静态函数setFallbackFontName()我也关注过,但是无论这条语句加在哪里,但没有丝毫改变。加在主程序类的initialise()函数中,也不行。

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

另外,Juce显示的文字,的确模糊,看起来很不舒服。Jules让我搜索,我找了整整一天,看了很多帖子,依然无法解决……


#14

到底哪个更清楚,诸位自己看:


#15

显示和输入中文,有很多办法,我可以实现(见下),但是必须设置,这样很麻烦!

1、设置Label标签所显示的字体属性:
helloWorldLabel->setFont (Font (T(“宋体”), 40.0000f, Font::bold));

2、设置文本编辑所用的字体:
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); // 设置文本编辑对象的字体

3、最省事的,一了百了的做法,修改:…\juce\src\native\windows\juce_win32_Fonts.cpp
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”;
}
else
{
// defaultSans = “Verdana”;
defaultSans = “宋体”; // 修改此处!
defaultSerif = “Times”;
defaultFixed = “Lucida Console”;
}
}


#16

Google translate :slight_smile:

[quote]
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

http://www.mozilla.org/projects/intl/input-method-spec.html

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!
http://www.rawmaterialsoftware.com/viewtopic.php?f=2&t=5623&hilit=text+rendering
http://www.rawmaterialsoftware.com/viewtopic.php?f=2&t=4746&hilit=text+rendering&start=15


#17

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.


#18

Justin,ありがとうございます。
Google translation to do a good job :wink:


#19

L “…” I forget it?


#20

兄弟…我来帮你了,
juce我这也研究半天了,中文的问题,绝对是字体的问题!!
你看这个:

[attachment=0]未命名.jpg[/attachment]

把字体改一改,一切都好弄多了…
而且…你是小T吧…我门子…你是不是打算做简谱软件呢呵呵?

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