Tue 13 Dec 2016 01:05:48 PM UTC, comment #10:
Ah, the previous comment expresses my intent, but there was a bug. Fixed in git:
http://git.savannah.gnu.org/cgit/man-db.git/commit/?id=d450d4c2d3c09a629ef95d02d250a6cb290764ca
|
Tue 13 Dec 2016 12:10:30 PM UTC, comment #9:
man-db actually extracts just the language from the path, so it loads zh.tmac rather than zh_CN.tmac.
I consider this mostly as a useful backstop. It's still a good idea for individual pages to load the appropriate macros themselves; but loading them automatically system-wide gives users a better experience more quickly.
|
Sat 09 May 2015 09:18:18 AM UTC, comment #8:
I agree with you and decide to solve it by adding `. mso zh.tmac`.
Thanks for your help.
|
Fri 01 May 2015 01:45:51 PM UTC, comment #7:
> [...] at least there should be an entry in tmac/tmac.am
> to install `zh.tmac`.
Fixed.
> Another problem is there should be two files zh_CN.tmac
> and zh_TW.tmac.
Here I disagree. The `zh' indicates the language, while `CN' and `TW' gives the country. The language is the same, even if there are different conventions, e.g. different punctuation characters and simplified vs. traditional glyphs. Your`zh.tmac' covers both, so no need for two separate files.
> As far as I know the `man` command uses
> the path info to determine what language the
> groff-format file is using.
>
> eg.
> /usr/share/man/zh_CN/man1/man.1
>
> It seems the string 'zh_CN' is extracted.
I consider this a bug. If there is no `xx_XX.tmac', it should try `xx.tmac' next. On the other hand, I would rather expect that the language selection file is part of the man page itself!
IMHO, it's not the job of the `man' program to supply this data. Just imagine to view the man page directly with groff – how shall I know the file's language?
Colin, can you chime in, please?
|
Fri 01 May 2015 01:13:39 PM UTC, comment #6:
Hi Werner LEMBERG,
I checkout the source code but only zh.tmac is added. I am not familiar with groff itself and how the command man works. But at least there should be an entry in tmac/tmac.am to install `zh.tmac`.
Another problem is there should be two files zh_CN.tmac and zh_TW.tmac.
As far as I know the `man` command use the path info to determine what language the groff-format file is using.
eg.
/usr/share/man/zh_CN/man1/man.1
It seems the string 'zh_CN' is extracted.
Thanks a lot for your work on improving Chinese typesetting.
|
Thu 30 Apr 2015 07:40:43 AM UTC, comment #5:
Thanks a lot! Committed to git, please test.
|
Wed 29 Apr 2015 10:54:54 AM UTC, comment #4:
.\" The following rules are for zh_CN and should be put into zh_CN.tmac
.\" And these rules should work for zh_TW too.
.\" Locale string
.
.ds locale chinese\"
.
.
.class [CJKprepunct] \
, : ; > } \
\[u2026] \[u201D] \
\[u3001] \[u3002] \[u3009] \[u300B] \[u300D] \[u300F] \[u3011] \
\[uFF01] \[uFF09] \[uFF0C] \[uFF1A] \[uFF1B] \[uFF1F]
.class [CJKpostpunct] \
\[u201C] \[u3008] \[u300A] \[u300C] \[u300E] \[u3010] \[uFF08]
.
.\" Chinese glyphs.
.class [CJKnormal] \
\[u4E00]-\[u9FFF]
.
.cflags 128 \C'[CJKprepunct]'
.cflags 266 \C'[CJKpostpunct]'
.cflags 512 \C'[CJKnormal]'
|
Tue 28 Apr 2015 08:46:13 AM UTC, comment #3:
> I am willing to write a zh.tmac for groff.
Great! Assuming that only minor changes are necessary compared to ja.tmac, I guess it's OK if you simply post a patch here, not needing a copyright disclaimer.
Of course, the main problem is CJK output for non-TTY devices, due to lack of native TTF and OTF support. But this is a different issue.
|
Tue 28 Apr 2015 08:22:12 AM UTC, comment #2:
Thanks for your awesome work. I put the Chinese man.1 in ~/.local/man/ja/man1/man.1 and browser it using Japanese typesetting.
Cool, just what the effect I want to see.
I am willing to write a zh.tmac for groff.
|
Mon 27 Apr 2015 05:52:03 PM UTC, comment #1:
Have you played around with the `.class' request? In particular, you should read the documentation in groff's info file, then check the file `ja.tmac', which sets up punctuation rules for Japanese. In other words, if you have a Japanese manpage you should load `ja.tmac'.
Do you want to contribute something similar for Chinese?
|
Mon 27 Apr 2015 04:49:34 PM UTC, original submission:
There are severe typesetting problems. Please see the attached screenshot.
1. Typesetting for pure Chinese text is quite easy. Just place it there. Chinese characters do not separate by spaces. There is no need to streach spaces.
2. When typesetting Chinese with English. Just regard each Chinese character as an English word. Current rule seems to regard a Chinese sentence as an English word, since there are no spaces between Chinese characters.
3. Line break algorithm. A line should not begin with punctuation characters. When there are conflicts, feel free to put some spaces at the end of the line.
These rules should also work for Korean and Japanese man pages.
|