character like Chinese not supported

Wenbin
2010-08-02
2012-10-17
  • Wenbin
    Wenbin
    2010-08-02

    Though TexMakerX suppports UTF-8, but there is a problem with two-bytes
    character display, such as Chinese. The cursor won't appear at the end of the
    input Chinese character, instead, in the middle point of the character. And if
    you input more, more wired it becomes.

    If a one-byte Chinese font is used, this problem can be solved. But almost all
    Chinese fonts are two-bytes. And TexMaker doesn't have this problem.

     
  • Wenbin
    Wenbin
    2010-08-02

    I upload a screen shot, here is the link
    http://j.imagehost.org/0354/exmp.png

     
  • I couldn't reproduce it, but probably I've the wrong text and fonts.

    Can you post an example, and your fonts and operating system?

     
  • Wenbin
    Wenbin
    2010-08-04

    Hi, Benibela

    I created more screenshots, hope these can help you what the problem exactly
    is.

    http://i.imagehost.org/0071/pic1_8.png

    This figure shows the Chinese character are still in the input method bar.

     
  • Wenbin
    Wenbin
    2010-08-04

    http://a.imagehost.org/0301/pic2.png

    This figure shows when four Chinese characters are sent to the editor, the
    cursor stays in the middle.

     
  • Wenbin
    Wenbin
    2010-08-04

    http://i.imagehost.org/0043/pic3.png

    This one shows what happens when more characters are input. It is hard to find
    at which point you input your text if the cursor is not in the right place.

     
  • Wenbin
    Wenbin
    2010-08-04

    http://j.imagehost.org/0088/pic4.png

    When all texts are selected, only the part in front of the cursor is
    highlighted

     
  • Wenbin
    Wenbin
    2010-08-04

    I use the default font, my system is XP pro sp3, English,
    TexMakerX font setting, default.

     
  • could you attach a small text file which contains some chionese characters, so
    that we can debug the thing here ?
    (like the file which you used for your screenshots ...)

     
  • Wenbin
    Wenbin
    2010-08-04

    Hi, Jsundermeyer,

    I have created a txt file (utf- 8), only one sentence; it can be downloaded at
    http://www.box.net/shared/p99zg8i06y

    If you need a longer one, I will upload it tomorrow.

     
  • thanks. i will take a look into it

     
  • the problem arises because these chinese characters are wider than the space
    character although a monspaced font is used. Thus the optimizations fail.
    As a work around, use any non monospaced font and things are fine. (the font
    name normally contains the expression "mono" for monospaced. Just select under
    Options/Editor/Font an appropriate font. As i am using linux, i can't say what
    win xp provides ...)
    (you would no be interested in translating tmx menus to chinese ? :-) )

     
  • Wenbin
    Wenbin
    2010-08-04

    Hi, Jsundermeyer,

    The problem is that all Chinese characters are not mono-spaced. Someone
    mentioned that this problem can solved by using a mono Chinese font. However,
    this font is commercial, rarely used and uggly. ( It seems that some other
    software has this problem too.)

    I would like to help translate TexMakerX once this problem is solved.

    Actually, I don't use TexMakerX to write articles in Chinese ;). The reason
    why I reported the bug here is that I went to a tex forum in Chinese, lots of
    them gave up this excellent editor because of this issue. It's a pity.

     
  • Texmaker has no problems to render non-monospace fonts, but it needs to know
    that a font is non-monospace.
    There are three different render modes, one for monospace-only fonts, one for
    non-monospace fonts and one for right-to-left texts. In the first mode it
    won't render Chinese, but the other two modes should be fine. The default font
    Courier is monospaced (at least in non Chinese languages), so it uses the
    first mode in the default case (which is much faster than the other two).
    Therefore, what you can try as a workaround is:
    -) Use a non-monospace font (e.g. Arial or Times New Roman)
    -) Add on the editor page any font in any of the fields in the font column of the format table. This will disable the first render mode.
    -) Add a rtl unicode marker on every line to trigger the third mode

    And we have to find a Windows computer to test it also

     
  • olympustex
    olympustex
    2010-08-05

    Texmaker has no problems to render non-monospace fonts, but it needs to know
    that a font is non-monospace.

    As usual, you make a confusion between texmaker and texmakerX.
    This bug only affects texmakerX (and not texmaker) because of the QCodeEdit
    component.
    QCodeEdit :
    - was created for C/C++ like documents and not for latex ones;
    - have a lot of encoding troubles with no-latin characters (for latex documents, encoding is very important)
    - has never correctly detected the encoding of a file. QCodeEdit only detects it the document is unicode; otherwise it considers automatically the document as iso-8859-1...
    - even with utf-8 encoding, it doesn't display correctly the characters with all fonts;
    - have a lot of bugs and is no more maintained since one year.

    Using a component like this for a latex editor is a very bad idea...

     
  • As usual, you make a confusion between texmaker and texmakerX.

    That was of course a spelling error, I'm only talking about TexmakerX here.

    Using a component like this for a latex editor is a very bad idea...

    You're right, that's why tmx doesn't use qcodeedit anymore, but my fork of
    qcodeedit

     
  • Wenbin
    Wenbin
    2010-08-05

    Hi, Benibela

    I tested your solution (only render mode 2), now the cursor is in the correct
    place now. Thanks. I will post the solution to the Chinese Tex forum.

     
  • Wenbin
    Wenbin
    2010-08-05

    Correct one of my previous statements:

    The problem is that all Chinese characters are not mono-spaced.

    This is not right. I did a bit research: there are Chinese fonts that are
    mono-spaced. Maybe the default system Chinese font is mono-spaced.

     
  • i have implemented a fix for the problem in svn revision 1108 (auto checking
    for asian characters which disables some optimizations if they are found)