:right command on Chinese characters

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

:right command on Chinese characters

Joey Ling
When I run :right command in gvim, it's ok, like this:

                       彼外道常说自然,我说因缘。——楞严经

But if I open the txt file with Word, it's like this:

                        彼外道常说自然,我说因缘。——楞严

The last character is returned to the next line, what's wrong?

--
--
You received this message from the "vim_use" 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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: :right command on Chinese characters

Tim Chase
On 2017-05-21 19:54, Joey wrote:

> When I run :right command in gvim, it's ok, like this:
>
>                        彼外道常说自然,我说因缘。——楞严经
>
> But if I open the txt file with Word, it's like this:
>
>                         彼外道常说自然,我说因缘。——楞严
> 经
>
> The last character is returned to the next line, what's wrong?

Does the result change in any of the following cases:

- you set 'tw' to something smaller or 'wm' slightly larger?

- you set the font smaller in Word?

- you increase your left/right margins in Word?


I suspect what's happening is that, since Vim does the
right-justification with spaces, Word is displaying all those spaces
and then not having enough room to display the last character, so it
bumps it to the next line.  So the first "solution" would have vim
add fewer spaces before the right-justified text in the actual
document, while the second & third ideas increase the number of
characters that Word should be able to fit on a line.

-tim


--
--
You received this message from the "vim_use" 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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: :right command on Chinese characters

Nikolay Aleksandrovich Pavlov
In reply to this post by Joey Ling
2017-05-21 14:54 GMT+03:00 Joey <[hidden email]>:

> When I run :right command in gvim, it's ok, like this:
>
>                        彼外道常说自然,我说因缘。——楞严经
>
> But if I open the txt file with Word, it's like this:
>
>                         彼外道常说自然,我说因缘。——楞严
> 经
>
> The last character is returned to the next line, what's wrong?

As Tim Chase said Vim does right justification with spaces, it is not
“real” right justification which is done using some form of “set
paragraph attribute ‘align’ to ‘right’”. You can do this in HTML (via
using CSS attribute `text-align: right`), doc[x] (Word has a button
for this), etc, but not in a txt file, and not with `:right` command.

You need to ask yourself “what do I need right alignment for” and act
accordingly, adjusting &textwidth to make text look right *on your
computer with yours Word window size, zoom factor and window
resolution* will do no good because it will no longer look right once
some of factors changes. Maybe you just need to create an rtf document
instead using Word and set that paragraph attribute there.

>
> --
> --
> You received this message from the "vim_use" 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
>
> ---
> You received this message because you are subscribed to the Google Groups
> "vim_use" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [hidden email].
> For more options, visit https://groups.google.com/d/optout.

--
--
You received this message from the "vim_use" 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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: :right command on Chinese characters

Joey Ling
In reply to this post by Tim Chase
On Sunday, May 21, 2017 at 8:15:50 PM UTC+8, Tim Chase wrote:

> On 2017-05-21 19:54, Joey wrote:
> > When I run :right command in gvim, it's ok, like this:
> >
> >                        彼外道常说自然,我说因缘。——楞严经
> >
> > But if I open the txt file with Word, it's like this:
> >
> >                         彼外道常说自然,我说因缘。——楞严
> > 经
> >
> > The last character is returned to the next line, what's wrong?
>
> Does the result change in any of the following cases:
>
> - you set 'tw' to something smaller or 'wm' slightly larger?
>
> - you set the font smaller in Word?
>
> - you increase your left/right margins in Word?
>
>
> I suspect what's happening is that, since Vim does the
> right-justification with spaces, Word is displaying all those spaces
> and then not having enough room to display the last character, so it
> bumps it to the next line.  So the first "solution" would have vim
> add fewer spaces before the right-justified text in the actual
> document, while the second & third ideas increase the number of
> characters that Word should be able to fit on a line.
>
> -tim
I have set the same 80 characters per line for both Vim and Word, in my opion, they should display the same, am I wrong?

--
--
You received this message from the "vim_use" 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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: :right command on Chinese characters

Tim Chase
On 2017-05-22 01:49, Joey Ling wrote:

> On Sunday, May 21, 2017 at 8:15:50 PM UTC+8, Tim Chase wrote:
> > I suspect what's happening is that, since Vim does the
> > right-justification with spaces, Word is displaying all those
> > spaces and then not having enough room to display the last
> > character, so it bumps it to the next line.  So the first
> > "solution" would have vim add fewer spaces before the
> > right-justified text in the actual document, while the second &
> > third ideas increase the number of characters that Word should be
> > able to fit on a line.
>
> I have set the same 80 characters per line for both Vim and Word,
> in my opion, they should display the same, am I wrong?

In vim, 80 characters is 80 character-cells so it fits exactly.  In
Word, AFAIK, there is no "make the width 80 characters" but rather
margins (set in units of inches/mm/cm/whatever) and variable fonts
(set in units of points, potentially monospace, potentially
proportional).  So Vim is giving you 80 actual characters, but Word
is not giving you 80 full-width-Chinese-glyph characters. Rather,
Word may be giving you 80 of *some* average character (usually an
"M") and doing whatever it wishes with the spacing. For best results
in Word, you'd want to specify a monospace font and paste 80 wide
characters, then set your margins & font-size accordingly.

-tim


--
--
You received this message from the "vim_use" 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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Loading...