Little tips: Display the Far East characters


#1

In the process of exploration and learning JUCE, I obtained Jules and other friends to help. To express gratitude, I share some of their own experience, want to give some help novice. My programming skills is very low, English is not good, Please give me criticism and correction.

How to display the Far East text? there are some ways. I am here to give a simple, just four steps:

① add a base component class to inherit the base class: LookAndFeel. For example:
class ContentComp: public Component, public MenuBarModel,
public ApplicationCommandTarget, public LookAndFeel

② in base component class’s constructor, add the following two statements:
setDefaultSansSerifTypefaceName (T (“华文细黑”)); // set font
setDefaultLookAndFeel (this); // Set the appearance

③ base component class destructor to add the appearance of zero in the statement:
setDefaultLookAndFeel (0); // set to zero

④ involves the conversion of char, all changes to wchar_t. Such as the setup menu group name:
const char * const names [ ] = {T (“文件”), T (“查看”), 0}; / / wrong!
const wchar_t * const names [ ] = {T (“文件”), T (“查看”), 0}; / / right!
Therefore, to ensure accurate, best to use all the strings T ("…") in the form of macro definitions, or use the L “…” syntax.