Do not panic. Ask here before giving up.
Issue With Korean translation of Upp Linux application
Hello, We are having difficulty with our app displaying Korean characters. We have followed the directions given here to others: http://www.ultimatepp.org/forums/index.php?t=msg&goto=43 537& We did a copy/paste of the Korean text into t file using Theide editor. Initially, it looks like squares before Upp compilation. The build succeeds and Upp changes the text in the t file to hex numbers. However, these don't render as Korean text in the application but continue to look like squares. A screen image is captured as an example. It is attached along with the t file for this project in tar.gz format. The t file line numbers of the four text in buttons are line #7773, #7787, #7419, and #7808. We used Google translate to go from English --> Korean. For example: "Update vT Software" gets translated to "업데이트 VT 소프트웨어" It is those Korean characters that we copy/paste into Theide for further conversion to the hex number sequences. However, all we get from Upp rendering in our application is square boxes. T file encodings and font in Upp are default utf8 and Monospace. P.S. Copy/paste of the same Google translated Korean text into Leafpad editor renders proper Korean text, and not squares. Additional Context: - Host: is Linux Mint 17.2 on Intel architecture - Upp: we are using upp-x11-src-8760 snap-shot Any suggestion regarding this is very much appreciated. --Jeff
Re: Issue With Korean translation of Upp Linux application
Appears to be a font problem. In Win32, it works. CJK characters are handled by "replacement fonts". Unfortunatly, identifying which fonts contain which characters is very slow process, so U++ has fixed font tables to accelerate this (in Draw/FontCR.cpp). We will need to add some typical Linux fonts that support Korean. I have identified these fonts in my distro (Mint) to support Korean: "WenQuanYi Micro Hei Mono" "NanumMyeongjo" "NanumGothic" "WenQuanYi Micro Hei", - that fixed problem for me. Anyway, you might want to run this simple utility to eventually find more fonts in your distro that support Korean: #include <CtrlLib/CtrlLib.h> using namespace Upp; GUI_APP_MAIN { ArrayCtrl a; a.AddColumn(); for(int i = 0; i < Font::GetFaceCount(); i++) { DDUMP(Font::GetFaceName(i)); a.Add(AttrText(String().Cat() << AsString(i) << ' ' << Font::GetFaceName(i) << " 업데이트 VT 소프트웨어") .SetFont(Font(i, StdFont().GetHeight()))); } TopWindow w; w.Add(a.SizePos()); w.Run(); } Then, there are bitfield maps in FontCR. You can use uppbox/FontMaps to generate them... (also, it is a nice demonstration why we need these fixed maps - it is pretty slow
Mirek, Thank you for responding to the question and the investigative work you did. You said: "...We will need to add some typical Linux fonts that support Korean." Is there a time table for this to happen? Will it be announced as a release or will it show up in a nightly snap shot? If this were available, we would like to make use of it since we have a need for this in our project. Again, thank you for your help. -- Jeff
It is in trunk (and thus in nightly build). Anyway, I have added fonts I have on my distro, so if the problem is not fixed for you (unlikely), my previous message contains intructions how to fix it. Mirek
Yes, that fixes the Korean character rendering. Thank you for the solution to this. We are so ecstatic about this! And then I was asked: "Can this solution can be back-ported into upp-2007.1 ?" I told them I would look at the code and see. There does not seem to be a list of language character fonts in upp-2007.1 and so I don't know how to do that. Is there a way that we can back-port the functionality for rendering Korean characters into upp-2007.1 ? -- Jeff
jfranks wrote on Wed, 25 November 2015 15:57 Yes, that fixes the Korean character rendering. Thank you for the solution to this. We are so ecstatic about this! And then I was asked: "Can this solution can be back-ported into upp-2007.1 ?" I told them I would look at the code and see. There does not seem to be a list of language character fonts in upp-2007.1 and so I don't know how to do that. Is there a way that we can back-port the functionality for rendering Korean characters into upp-2007.1 ? -- Jeff Unlikely. Why would you want to do such thing? Mirek