ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: "黄复雄 via ntg-context" <ntg-context@ntg.nl>
To: "amano.kenji" <amano.kenji@proton.me>,
	 mailing list for ConTeXt users <ntg-context@ntg.nl>
Cc: 黄复雄 <aahuaang@gmail.com>
Subject: Re: Is rendering furigana over horizontal or vertical japanese text doable in ConTeXt?
Date: Sun, 21 Aug 2022 16:24:22 +0800	[thread overview]
Message-ID: <CAHN0TNiaPxCA53_c7Hee-kB=f0kfKvJ0B-+CXgGMyo=JoetB+A@mail.gmail.com> (raw)
In-Reply-To: <UffUw12zH9ZFCn6pXjaiWjv1lvjGj2GKJWFia7-gumtMXBuSrAFUOT9R-w8d4Ho7kbNCdSNsO833IV7_iqAalaFYtir-ZQkdnKbQZKXOeNI=@proton.me>

Currently, the ruby module does not seem to support cjk fonts? I have
a preliminary implementation of furigana(pinyin in Chinese) as:

```lmtx
% define the pinyin font
\definefont[pinyinfont][name:ahpinying*default at 9pt]
% define the pinyin command
\define[2]\pinyin{%
    \setbox1 = \hbox{#1}%
    \setbox2 = \hbox{\darkgray \pinyinfont #2}%
    \newdimen\maxwd%
    \ifdim \wd1>\wd2 \maxwd=\wd1 \else \maxwd=\wd2 \fi%
    \setbox1 = \hbox to \maxwd{\hfill \box1 \hfill}%
    \setbox2 = \hbox to \maxwd{\hfill \box2 \hfill}%
    \hskip0pt plus5pt\vbox{\setupinterlinespace[line=0.5em]\box2\box1}%
above line
    % \hskip0pt
plus5pt\vtop{\setupinterlinespace[line=0.5em]\box1\box2}% under line
}
```
usage as follows:

```lmtx
\pinyin{寖備}{jìn bèi}
```

BTW, I hav made a vertical typesetting module for Chinese in ConTeXt LMTX,
vertical_typeset.lua in https://github.com/Fusyong/vertical-typesetting

You should modify the set for Japanese characters and punctuations here:

```lua
local function chars_to_vertical(c)
    return c >= 0x04E00 and c <= 0x09FFF
end

local puncs_to_rotate = {
[0x3001] = true, -- 、
[0xFF0C] = true, -- ,
[0x3002] = true, -- 。
[0xFF0E] = true, -- .
[0xFF1F] = true, -- ?
[0xFF01] = true, -- !
[0xFF1A] = true, -- :
[0xFF1B] = true, -- ;
}
```

and there is a doc for example, 大学章句.lmtx, in https://github.com/Fusyong/jiazhu,
and jiazhu.lua in same place is a module of Jiazhu (or 夹注, 割注) in ConTeXt LMTX.

But all the comments are in Chinese.


amano.kenji via ntg-context <ntg-context@ntg.nl> 于2022年8月16日周二 19:34写道:
>
> At least, furigana seems covered.
>
> How do I know which document to consult? There are many PDF files that come with ConTeXt.
>
> ------- Original Message -------
> On Monday, August 15th, 2022 at 3:39 PM, Wolfgang Schuster via ntg-context <ntg-context@ntg.nl> wrote:
>
>
> > amano.kenji via ntg-context schrieb am 15.08.2022 um 14:00:
> >
> > > Is there any documentation about \ruby?
> >
> >
> > You can see all available parameters in setup-en.pdf, the example below
> > shows a few of them:
> >
> > %%%% begin example
> > \setupinterlinespace[line=4ex]
> >
> > \setuptype[style=\ttx]
> >
> > \starttext
> >
> > \start
> > xxxxxxxxx \ruby{aaa}{bbb} xxxxxxxxx
> > \stop
> >
> > \start \setupruby[location=left]
> > \type{\setupruby[location=left]}\quad xxxxxxxxx \ruby{aaa}{bbb} xxxxxxxxx
> > \stop
> >
> > \start \setupruby[location=right]
> > \type{\setupruby[location=right]}\quad xxxxxxxxx \ruby{aaa}{bbb} xxxxxxxxx
> > \stop
> >
> > \start \setupruby[location=right,left={[},right={]}]
> > \type{\setupruby[left={[},right={]}]}\quad xxxxxxxxx \ruby{aaa}{bbb}
> > xxxxxxxxx
> > \stop
> >
> > \start \setupruby[align=flushleft]
> > \type{\setupruby[align=flushleft]}\quad xxxxxxxxx \ruby{aaaaaa}{bbb}
> > xxxxxxxxx
> > \stop
> >
> > \start \setupruby[align=flushright]
> > \type{\setupruby[align=flushright]}\quad xxxxxxxxx \ruby{aaaaaa}{bbb}
> > xxxxxxxxx
> > \stop
> >
> > \start \setupruby[style=\itxx]
> > \type{\setupruby[style=\itxx]}\quad xxxxxxxxx \ruby{aaa}{bbb} xxxxxxxxx
> > \stop
> >
> > \start \setupruby[color=blue]
> > \type{\setupruby[color=blue]}\quad xxxxxxxxx \ruby{aaa}{bbb} xxxxxxxxx
> > \stop
> >
> > \start \setupruby[voffset=-1.2ex]
> > \type{\setupruby[voffset=-1.2ex]}\quad xxxxxxxxx \ruby{aaa}{bbb} xxxxxxxxx
> > \stop
> >
> > \stoptext
> > %%%% end example
> >
> > > What about vertical text?
> >
> >
> > ConTeXt has a mechanism to produce vertical text but there is nothing
> > yet which can
> > be used out of the box to produce a complete document with vertical
> > paragraphs.
> >
> > Wolfgang
> >
> > ___________________________________________________________________________________
> > If your question is of interest to others as well, please add an entry to the Wiki!
> >
> > maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
> > webpage : https://www.pragma-ade.nl / http://context.aanhet.net
> > archive : https://bitbucket.org/phg/context-mirror/commits/
> > wiki : https://contextgarden.net
> > ___________________________________________________________________________________
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to the Wiki!
>
> maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki     : https://contextgarden.net
> ___________________________________________________________________________________
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________

  parent reply	other threads:[~2022-08-21  8:24 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-15 11:02 amano.kenji via ntg-context
2022-08-15 11:43 ` Taco Hoekwater via ntg-context
2022-08-15 12:00   ` amano.kenji via ntg-context
2022-08-15 15:39     ` Wolfgang Schuster via ntg-context
2022-08-16 11:33       ` amano.kenji via ntg-context
2022-08-16 15:05         ` Wolfgang Schuster via ntg-context
2022-08-21  8:24         ` 黄复雄 via ntg-context [this message]
2022-08-21 10:00           ` Hans Hagen via ntg-context
2022-08-21 10:10           ` Wolfgang Schuster via ntg-context
2022-08-21 16:19             ` Hans Hagen via ntg-context
2022-08-22  5:21               ` 黄复雄 via ntg-context
2022-08-22  7:16                 ` Hans Hagen via ntg-context
2022-09-03 10:44                   ` 黄复雄 via ntg-context
2022-08-22  2:09             ` 黄复雄 via ntg-context
2022-08-22  4:52             ` 黄复雄 via ntg-context

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAHN0TNiaPxCA53_c7Hee-kB=f0kfKvJ0B-+CXgGMyo=JoetB+A@mail.gmail.com' \
    --to=ntg-context@ntg.nl \
    --cc=aahuaang@gmail.com \
    --cc=amano.kenji@proton.me \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).