Complex Scripts in Vim/gVim

89 views
Skip to first unread message

Ujjwol (उज्जवल लामिछाने)

unread,
Sep 24, 2010, 2:56:46 AM9/24/10
to vim_dev
Guys, I am learning vim and it is great. But the problem with vim/gvim
is that it doesn't support any complex scripts like Devanāgarī. It is
not rendered properly. See the screenshots below:

Rendering in Vim
http://i.imgur.com/wqNh5.png

Correct Rendering which is displayed gEdit/emacs/KWrite
http://i.imgur.com/Zui3y.png

Is there any way to make vim/gvim support complex scripts? This
affects to all Indic scripts. Yes! I tried changing font just in case,
but it didn't work.

If I go on typing with the incorrect rendering(which is not readable),
and save it and check that file is gedit, the text is all written
correctly. There is only problem in display in Vim.

Thanks in Advance

Regards,
Ujjwol

Marc Weber

unread,
Sep 24, 2010, 6:27:15 AM9/24/10
to vim_dev
Excerpts from Ujjwol (उज्जवल लामिछाने)'s message of Fri Sep 24 08:56:46 +0200 2010:

> Guys, I am learning vim and it is great. But the problem with vim/gvim
> is that it doesn't support any complex scripts like Devanāgarī. It is
> not rendered properly. See the screenshots below:
>
> Rendering in Vim
> http://i.imgur.com/wqNh5.png
>
> Correct Rendering which is displayed gEdit/emacs/KWrite
> http://i.imgur.com/Zui3y.png
>
> Is there any way to make vim/gvim support complex scripts? This
> affects to all Indic scripts. Yes! I tried changing font just in case,
> but it didn't work.

I don't know that topic very well. You may want to try an utf-8 aware
terminal instead to find out whether the gvim terminal causes the trouble.
I'm not sure whether knowing this would help much. But that's what I
would try next.

Marc Weber

Ujjwol (उज्जवल लामिछाने)

unread,
Sep 24, 2010, 6:44:48 AM9/24/10
to vim_dev
Problem is I don't know any terminal that supports unicode. I tried
gnome-terminal, konsole, xterm and rxvt. They all don't render
properly.

Marc Weber

unread,
Sep 24, 2010, 6:54:48 AM9/24/10
to vim_dev
Excerpts from Ujjwol (उज्जवल लामिछाने)'s message of Fri Sep 24 12:44:48 +0200 2010:

> Problem is I don't know any terminal that supports unicode. I tried
> gnome-terminal, konsole, xterm and rxvt. They all don't render
> properly.

Can you attach a small text file with those characters?
http://software.schmorp.de/pkg/rxvt-unicode.html

I open your file in Vim and see what happens then.

Marc Weber

Ben Fritz

unread,
Sep 24, 2010, 10:41:25 AM9/24/10
to vim_dev


On Sep 24, 1:56 am, Ujjwol (उज्जवल लामिछाने)
<ujjwollamichh...@gmail.com> wrote:
> Guys, I am learning vim and it is great. But the problem with vim/gvim
> is that it doesn't support any complex scripts like Devanāgarī. It is
> not rendered properly. See the screenshots below:
>

What version of Vim are you using? I remember some changes were made
for rendering of some complex scripts for Vim 7.3 but I don't recall
the details. Maybe an upgrade will fix your problems?

Benjamin R. Haskell

unread,
Sep 24, 2010, 10:51:25 AM9/24/10
to vim_dev
On Fri, 24 Sep 2010, Ujjwol (उज्जवल लामिछाने) wrote:

> On Sep 24, 3:27 pm, Marc Weber <marco-owe...@gmx.de> wrote:
>> Excerpts from Ujjwol (उज्जवल लामिछाने)'s message of Fri Sep 24 08:56:46 +0200 2010:
>>
>>> Guys, I am learning vim and it is great. But the problem with
>>> vim/gvim is that it doesn't support any complex scripts like
>>> Devanāgarī. It is not rendered properly. See the screenshots below:
>>
>>> Rendering in Vim
>>> http://i.imgur.com/wqNh5.png
>>
>>> Correct Rendering which is displayed gEdit/emacs/KWrite
>>> http://i.imgur.com/Zui3y.png
>>
>>> Is there any way to make vim/gvim support complex scripts? This
>>> affects to all Indic scripts. Yes! I tried changing font just in
>>> case, but it didn't work.
>>
>> I don't know that topic very well. You may want to try an utf-8 aware
>> terminal instead to find out whether the gvim terminal causes the
>> trouble. I'm not sure whether knowing this would help much. But
>> that's what I would try next.
>>
>> Marc Weber
>
> Problem is I don't know any terminal that supports unicode. I tried
> gnome-terminal, konsole, xterm and rxvt. They all don't render
> properly.
>

rxvt-unicode is my terminal emulator of choice.

mlterm renders text better when shaping is required, IME.

I don't have any Devanāgarī-capable fonts installed here at work. Will
test tonight when I get home or tomorrow.

--
Best,
Ben

Ujjwol (उज्जवल लामिछाने)

unread,
Sep 24, 2010, 11:19:06 AM9/24/10
to vim_dev
Here is the Devanagari test file: http://drop.io/egigkig

On Sep 24, 3:54 pm, Marc Weber <marco-owe...@gmx.de> wrote:
> Excerpts from Ujjwol (उज्जवल लामिछाने)'s message of Fri Sep 24 12:44:48 +0200 2010:
>
> > Problem is I don't know any terminal that supports unicode. I tried
> > gnome-terminal, konsole, xterm and rxvt. They all don't render
> > properly.
>
> Can you attach a small text file with those characters?http://software.schmorp.de/pkg/rxvt-unicode.html

ZyX

unread,
Sep 24, 2010, 11:20:41 AM9/24/10
to vim...@googlegroups.com
Ответ на сообщение «Re: Complex Scripts in Vim/gVim»,
присланное в 18:41:25 24 сентября 2010, Пятница,
отправитель Ben Fritz:

No, it won't. I tested this on changeset d0049ff5969e with almost all of
media-fonts/* stuff installed (everything that is a font and is available
without unmasking) and it shows everything normally in font selector dialog, but
fails to show it in gvim. About terminal: this is probably incorrect, but it is
the best rendering I could obtain (konsole)?:

http://img-fotki.yandex.ru/get/5203/kp-pav.1/0_4fab5_c78b0cae_orig.png


Текст сообщения:

signature.asc

Ujjwol (उज्जवल लामिछाने)

unread,
Sep 24, 2010, 11:22:01 AM9/24/10
to vim_dev
If you use linux, then there are chances that you have font like Lohit
Hindi or Lohit Devanagari, if not here is the GPL'ed Lohit Devanagari:
http://drop.io/3d0o6m5

Ujjwol (उज्जवल लामिछाने)

unread,
Sep 24, 2010, 11:25:15 AM9/24/10
to vim_dev
I am using vim-enhanced-7.2.411-1. That's the latest in my distro.

Ujjwol (उज्जवल लामिछाने)

unread,
Sep 24, 2010, 11:29:15 AM9/24/10
to vim_dev
Konsole has one of best rendering after Gnome-terminal but both of it
is not correct.
>  signature.asc
> < 1KViewDownload

Benjamin R. Haskell

unread,
Sep 24, 2010, 12:05:21 PM9/24/10
to vim_dev
[reversing the top-posting, again]

On Fri, 24 Sep 2010, Ujjwol (उज्जवल लामिछाने) wrote:

> On Sep 24, 3:54 pm, Marc Weber <marco-owe...@gmx.de> wrote:
>> Excerpts from Ujjwol (उज्जवल लामिछाने)'s message of Fri Sep 24 12:44:48 +0200 2010:
>>
>>> Problem is I don't know any terminal that supports unicode. I tried
>>> gnome-terminal, konsole, xterm and rxvt. They all don't render
>>> properly.
>>
>> Can you attach a small text file with those characters?http://software.schmorp.de/pkg/rxvt-unicode.html
>>
>> I open your file in Vim and see what happens then.
>>
>> Marc Weber
>
> Here is the Devanagari test file: http://drop.io/egigkig
>

Can you just attach that? It's annoying enough that the site requires
Flash, but even after firing up something with non-broken Flash[1], the
'Download' link is inactive. WTF.

--
Best,
Ben

[1] I disable plugins in Chrome on principle, but even under other
browsers lately Flash is borked on x86_64 linux. (Under Gentoo, the
only "working" Flash browser under amd64 is Opera 10.11.)

ZyX

unread,
Sep 24, 2010, 12:45:33 PM9/24/10
to vim...@googlegroups.com
Ответ на сообщение «Re: Complex Scripts in Vim/gVim»,
присланное в 20:05:21 24 сентября 2010, Пятница,
отправитель Benjamin R. Haskell:

You can see example text on stackoverflow in the first comment to the question:
http://stackoverflow.com/questions/3776613/complex-scripts-in-vim-gvim. Here is
this text that can parsed with eval:
"\u0905\u0928\u0928\u094d\u0924: \u0935\u0948 \u0935\u0947\u0926:"

> [1] I disable plugins in Chrome on principle, but even under other
> browsers lately Flash is borked on x86_64 linux. (Under Gentoo, the
> only "working" Flash browser under amd64 is Opera 10.11.)

Opera uses its own plugin wrapper: operapluginwrapper-ia32-linux. You should
probably setup nspluginwrapper for other browsers.


Текст сообщения:

signature.asc

Marc Weber

unread,
Sep 24, 2010, 1:04:41 PM9/24/10
to vim_dev
Excerpts from Ujjwol (उज्जवल लामिछाने)'s message of Fri Sep 24 17:19:06 +0200 2010:

> Here is the Devanagari test file: http://drop.io/egigkig
A "test-file" is the smallest file which reproduces a problem.

Your file is 2644 lines long. It only contais a-z A-Z 0-9 and some
special characaters. Wasn't this problem about rendering UTF-8 like
characters?

I'm puzzled - sorry.

Marc Weber

Ujjwol (उज्जवल लामिछाने)

unread,
Sep 24, 2010, 1:08:45 PM9/24/10
to vim_dev
Ok here is the file. (I didn't know how to add file here so I posted
it there, Sorry!)
--------------------------
अनन्त: वै वेद: ।
कार्त्स्न्या ।
1.001.01a अ॒ग्निमी॑ळे पु॒रोहि॑तं य॒ज्ञस्य॑ दे॒वमृ॒त्विज॑म् ।
1.001.01c होता॑रं रत्न॒धात॑मम् ॥
1.001.01a a̱gnim ī̍ḻe pu̱rohi̍taṁ ya̱jñasya̍ de̱vam ṛ̱tvija̍m ।
1.001.01c hotā̍raṁ ratna̱dhāta̍mam ॥
---------------

Marc Weber

unread,
Sep 24, 2010, 1:32:41 PM9/24/10
to vim_dev
Excerpts from Ujjwol (उज्जवल लामिछाने)'s message of Fri Sep 24 19:08:45 +0200 2010:

> Ok here is the file. (I didn't know how to add file here so I posted
> it there, Sorry!)

It looks like this in my gvim:
http://mawercer.de/~marc/test.jpg
However I don't know those signs so I can't even think about judging
whether they are (should be?) the same as shown in your original files.

Marc

Ujjwol (उज्जवल लामिछाने)

unread,
Sep 24, 2010, 1:36:01 PM9/24/10
to vim_dev
The transliterated roman is correct as expected, but the complex
script the devangari is all messed up even in your screenshot, it is
barely readable. And about the test file: It is 435 bytes and has
only 6 lines.

Marvin Renich

unread,
Sep 24, 2010, 4:27:34 PM9/24/10
to vim_dev
* Ujjwol (उज्जवल लामिछाने) <ujjwolla...@gmail.com> [100924 13:09]:

> Ok here is the file. (I didn't know how to add file here so I posted
> it there, Sorry!)
> --------------------------
> अनन्त: वै वेद: ।
> कार्त्स्न्या ।
> 1.001.01a अ॒ग्निमी॑ळे पु॒रोहि॑तं य॒ज्ञस्य॑ दे॒वमृ॒त्विज॑म् ।
> 1.001.01c होता॑रं रत्न॒धात॑मम् ॥
> 1.001.01a a̱gnim ī̍ḻe pu̱rohi̍taṁ ya̱jñasya̍ de̱vam ṛ̱tvija̍m ।
> 1.001.01c hotā̍raṁ ratna̱dhāta̍mam ॥
> ---------------

These links show what it looks like for me in gvim [0] and in mutt in
gnome-terminal [1]. I am running Debian testing, with many fonts
installed. I installed ttf-devanagari-fonts prior to taking the screen
shots, but the email seemed to display properly for me (as best as I can
tell without having any prior experience with devanagari script) even
before I installed that font. I note a slight difference in the placing
of a couple marks (I don't know the proper font terminology) between the
gvim and the mutt renditions.

[0] http://www.renich.org/vim/gvim_scrot.png
[1] http://www.renich.org/vim/mutt_scrot.png

...Marvin

Ujjwol (उज्जवल लामिछाने)

unread,
Sep 24, 2010, 11:58:56 PM9/24/10
to vim_dev
Marvin, The rendering of Devanagari is wrong and not readable in both
the screenshots. I don't know what's the issue is, glyph is shown
correctly but the positioning of them is incorrect in every terminal
and gvim.

On Sep 25, 1:27 am, Marvin Renich <m...@renich.org> wrote:
> * Ujjwol (उज्जवल लामिछाने) <ujjwollamichh...@gmail.com> [100924 13:09]:

Ujjwol (उज्जवल लामिछाने)

unread,
Sep 24, 2010, 11:59:37 PM9/24/10
to vim_dev
You could just check this thread in modern browser like Firefox
(chrome has some issues) to see the correct rendering.

On Sep 25, 1:27 am, Marvin Renich <m...@renich.org> wrote:

> * Ujjwol (उज्जवल लामिछाने) <ujjwollamichh...@gmail.com> [100924 13:09]:

Ujjwol (उज्जवल लामिछाने)

unread,
Sep 29, 2010, 11:54:43 PM9/29/10
to vim_dev
And does vim need monospace fonts ? Devanagari cannot have monospace
fonts.

On Sep 25, 8:59 am, Ujjwol (उज्जवल लामिछाने)

Ben Fritz

unread,
Sep 30, 2010, 10:23:53 AM9/30/10
to vim_dev


On Sep 29, 10:54 pm, Ujjwol (उज्जवल लामिछाने)
<ujjwollamichh...@gmail.com> wrote:
> And does vim need monospace fonts ? Devanagari cannot have monospace
> fonts.
>

Yes, Vim (and gvim) require monospace fonts. On some systems, you can
force the use of a non-monospace font in gvim, but it will look
strange because even then Vim will treat it as a monospace font. Vim
treats the screen as a grid of characters of a certain width and
height. Non-monospace fonts do not fit into this grid properly.

What do you mean that "Devanagari cannot have monospace fonts"? Does
this mean that there are some features of the script that somehow
cannot possibly be represented in monospace?

Ujjwol Lamichhane

unread,
Sep 30, 2010, 12:31:22 PM9/30/10
to vim...@googlegroups.com
Yes, Devanagari is written under a common stroke(line) it is not to be separated. So, it cannot have monospace between characters and different character merge to make ligature making it impossible to render monospaced. For example: Just see the Common line in the upper part.
विम् देवनागरी अक्षरं सम्पादनं कर्तु नशक्नोति ।

That's the issue, devanagari cannot have monospaced fonts and grid wise treatment makes it difficult to render and input it.

--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php



--
Ujjwol Lamichhane
http://ujjwol.com.np/

Reply all
Reply to author
Forward
0 new messages