Incorrect Japanese font rendering inside NSControl object - objective-c

I'm building a UI application in macOS with dynamic localization (meaning that it's possible to switch language while the application is running).
I've noticed that if the initial language is configured to Japanese, and I switch to English on-the-fly, the text on the controls is rendered ok.
However, on the opposite case, when the initial language is English and I switch to Japanese on-the-fly, the Japanese symbols on the text field come out a little bit enlarged. (see below drawings to emphasize the difference - the left snippet is the original rendering while the right one represents the enlarged version)
For any particular control, the language is changed by simply assigning the localized string (taken with help of NSLocalizedString function) to the stringValue property of the control.
These results appeared on all versions I've tested (both 10.13 and 10.12).
Perhaps anybody encountered similar results? how should I resolve them ?

So apparently the rendering problem is resolved if the Language is properly installed on your machine under Language and Regions -> Preferred Languages

Related

Is it possible to mix different fonts for different alphabets?

My use case is as such: my web application is only available in English and we are using the font Nunito. Some people write within the app with characters from other alphabets, but it works, I guess because the browser automatically changes the font. So for example if I write this, it works: γεια σας สวัสดี 你好 Helló ሰላም صباح الخير
But you can make a PDF export from my app, and I had to declare the font for the export, so of course now the characters not included in Nunito are replaced with blank rectangles.
I want the PDF export to display all the characters, and I know the font Noto is available in a lot of languages with different alphabets, but the thing is, as I said, our app is only available in English, so I cannot use a specific font depending on the selected language, and even if it was possible, that wouldn't fix the problem when mixing different alphabets.
So my question is: is there a single font that includes "a lot of" alphabets; or is there a way to load different fonts (such as all the Noto variants) and add a mechanism that chooses the best one for every character (something like a fallback from font to font, like I guess the browsers do)?

Xamarin Forms FontIcon Upper Bitplane XAML Escape Character

I'm trying to use MaterialDesignIcons in a Xamarin Forms Shell app. The latest version of this font encodes all of the glyphs in the upper bit planes (see this old StackOverflow question about that).
The problem I have is that I don't know how to identify the proper XAML escape sequence for upper bit plane glyphs. For example, \uf30c in C# code translates to  in XAML. But I don't know how to translate an upper bit plane value (e.g. \U000f0706) to the correct XAML escape sequence.
I thought I'd just use a binding to code instead, but this is blocked by an open bug. There's a workaround in that GitHub issue, but it doesn't seem to work for a Tab Bar Icon (which is where I'm trying to use it).
TL;DR - how to I write \U000f0706 in XAML?

Word Interop (COM) Proofing Options

I have documents that do not retain their proofing options.
I have some code that now ensures all styles are set to the correct language and has proofing turned on:
For Each s As Style In oDocument.Styles
Select Case s.Type
Case WdStyleType.wdStyleTypeCharacter, WdStyleType.wdStyleTypeParagraph, WdStyleType.wdStyleTypeTable
s.NoProofing = False
s.LanguageID = WdLanguageID.wdEnglishUK
End Select
Next
If I check the proofing options in the document without selecting any text, the following is displayed:
Proofing Options, No Text Selected
If I check the proofing options in the document with all text selected, the following is displayed: Proofing Options, All Text Selected
I have tried the following code snippet, but it did not work:
For Each range As Range In oDocument.Words
range.LanguageID = WdLanguageID.wdEnglishUK
range.NoProofing = False
range.LanguageDetected = False
Next
The behavior described in the question indicates mixed language formatting is present in the document.
Firstly, language formatting can be applied directly (similar to font formatting) rather than being controlled solely by styles. The language defined in a style will not override direct language formatting.
Additionally, "odd" behavior with language formatting often occurs when a document was created on a machine where the OS default language is different from Word's default language. The problem began with Office 97, where Microsoft changed Word's default behavior and has it check the Windows language and apply it to a new document if Word's default language is not identical. The information is written deeply into the document structure, where the Word UI is not able to change it. It can only be removed by editing the underlying Word Open XML.
Due to massive complaints by professionals who use Word, the behavior was somewhat alleviated in later versions to the point where selecting the entire body of the document (Ctrl+A) then applying the desired language directly could mostly prevent newly added text from being incorrectly formatted with the Windows language.
If manually selecting the entire document and applying the language directly does not change the behavior (object model equivalent Document.Content.LanguageID =), the only recourse would be to delve into the document's "zip package", inspect the XML to track down where the other language is stored, and remove it. This information can be used to create a solution with the Open XML SDK (or using standard Packaging and XML namespaces in the .NET Framework) so that it can be used on "any" document (YMMV)
Note: I have done this manually, but it was some time ago, so I don't remember exactly in which XML file in the zip package the Windows language is written.

I can not change language on xwiki

Dose anyone know how to change language on xwiki?
I followed this link below, but, nothing change at all.
http://www.xwiki.org/xwiki/bin/view/Documentation/UserGuide/Features/I18N
The step is following.
Go to XWikiPreferences.
Click content.
Click localization.
Change SUPPORTED LANGUAGES and default language.
I am Japanese so I choose Japanese, namely 日本語.
Set timezone
Click on save button.
Environment: Centos 6
java 1.8.0
xwiki 10.1
Do I have to take another action when I want to change language?
Best regards,
TL;DR: It worked, but unfortunately XWiki's User Interface is not yet translated into Japanese. Check by editing a page and looking at the editor's labels.
Longer answer:
As you can see from the link you mentioned (and the updated list http://l10n.xwiki.org/xwiki/bin/view/L10N/ - see the "Supported Languages" panel, on the right), XWiki does not list Japanese as supported language. This just means that there are no available translations for that language, so the User Interface will show the text labels in the English default.
This does not stop you from setting your wiki, as you did, to use the Japanese language. One way to check that the setting has taken effect is to edit a page and see the WYSIWYG editor's UI showing labels (like when hovering with the mouse over its buttons) in Japanese. This is a bit of a special case, since that editor provides its own translations and it just happens that it includes Japanese. (for information, that component is a 3rd party project, integrated into XWiki, so it manages its own translations that get distributed and integrated with the editor)
Additionally, if you set your wiki to be multilingual, it makes sense to use even languages where the UI is not translated yet because you will be able to edit various translations for the same page, should your usecase need that feature.
If you want to do something about it, you are welcomed to check out the translations wiki http://l10n.xwiki.org/xwiki/bin/view/L10N/ and start translating XWiki's UI for the Japanese language. The next release will include your translations and a lot of people, including yourself, will be grateful for it :)

Make user defined language in Notepad++ work regardless of theme

I have imported a Less style that a developer had recommended on this website, but there is a slight problem - it is made for specific themes only.
Without editing any XML files, is there any way to get this language file working regardless of theming? Like the built-in languages.
Language file working regardless of the theme – as far as I know the answer is no. Also check here.
If you do not want to edit XML files, you can still change colors by selecting Define your language... item in menu Language and change the colors of syntax categories using color pickers.
Adding your language into list of built-in languages is not easily possible unless you wish to play with N++ sources. You are supposed to use user-defined languages for standard tasks. However you can:
disable all unnecessarly languages in Language menu section in Preferences window and uncheck the Make language menu compact so you will get flat list of languages in menu.
access your language menu item faster by pressing Alt+L, then 2×Up and Enter