Werner LEMBERG <w...@gnu.org> writes: > Any progress on the docs?
Please find below a patch to the docs. Sorry for the delay.
diff --git a/NEWS b/NEWS index c5028c4..8b5f17e 100644 --- a/NEWS +++ b/NEWS @@ -24,6 +24,10 @@ o There is a new warning category `file', enabled by default. The `mso' request emits warnings in this category when the requested macro file does not exist. +o The new `class' request assignes a short name to a set of + characters, which can be referred to in `cflags' request to control + line-breaking and hyphenation rules in CJK languages. + Tbl --- diff --git a/doc/groff.texinfo b/doc/groff.texinfo index ae2ac6e..4a4f318 100644 --- a/doc/groff.texinfo +++ b/doc/groff.texinfo @@ -8726,6 +8726,7 @@ special symbols (Greek, mathematics). * Font Families:: * Font Positions:: * Using Symbols:: +* Character Classes:: * Special Fonts:: * Artificial Fonts:: * Ligatures and Kerning:: @@ -9122,7 +9123,7 @@ this is font 1 again @c --------------------------------------------------------------------- -...@node Using Symbols, Special Fonts, Font Positions, Fonts and Symbols +...@node Using Symbols, Character Classes, Font Positions, Fonts and Symbols @subsection Using Symbols @cindex using symbols @cindex symbols, using @@ -9458,7 +9459,9 @@ width, depth, and height, nothing else. All manipulations with the modified with the @code{cflags} request. The first argument is the sum of the desired flags and the remaining arguments are the characters or symbols to have those properties. It is possible to omit the spaces -between the characters or symbols. +between the characters or symbols. Also you can use the character class +references here with the escape @code{\C'[...@var{class}]'} (see +...@ref{character Classes} for more details). @table @code @item 1 @@ -9639,7 +9642,56 @@ The request @code{rfschar} removes glyph definitions defined with @c --------------------------------------------------------------------- -...@node Special Fonts, Artificial Fonts, Using Symbols, Fonts and Symbols +...@node Character Classes, Special Fonts, Using Symbols, Fonts and Symbols +...@subsection Character Classes +...@cindex character classes +...@cindex classes, character + +A @dfn{class} (aka ``character class'') is a set of characters, +grouped by some user aspect. The request @code{class} defines classes +so that other requests can refer to characters belonging to a class, +with a short class name. + +Classes are particularly useful for East Asian languages such as +Chinese, Japanese, and Korean, where there is a much larger set of +characters than in European languages. + +A @code{class} request takes a class name followed by a list of +characters. For example: + +...@example +.class [prepunct] , : ; > @} +...@endexample + +To access the contents of a class, use the escape +...@code{\c'[...@var{class}]'}. With the escape, you can define nested +classes. Also, you can use the character range notation (a starting +character code point, followed by a @samp{-} and an ending character +code point), to avoid enumerating characters explicitly. Here is more +complex example: + +...@example +.class [CJKprepunct] \C'[prepunct]' \[u2013]-\[u2016] ... +...@endexample + +The class @samp{CJKprepunct} contains the contents of the class +...@samp{prepunct}, i.e. @samp{, : ; > @}}, and characters in the range +between @code{U+2013} and @code{U+2016}. + +Typical usage of the @code{class} request is to control line-breaking +and hyphenation rules together with the @code{cflags}. For example, +to inhibit line-break before the characters belonging to the +...@samp{cjkprepunct}, you can write: + +...@example +.cflags 2 \C'[CJKprepunct]' +...@endexample + +See the @code{cflags} request in @ref{Using Symbols}, for more details. + +...@c --------------------------------------------------------------------- + +...@node Special Fonts, Artificial Fonts, Character Classes, Fonts and Symbols @subsection Special Fonts @cindex special fonts @cindex fonts, special diff --git a/man/groff_diff.man b/man/groff_diff.man index 115c6d2..3bdfa47 100644 --- a/man/groff_diff.man +++ b/man/groff_diff.man @@ -1093,6 +1093,17 @@ This is useful for removing the newline from the end of diversions that are to be interpolated as strings. . .TP +.BI .class\ name\ c1\ c2\|.\|.\|.\& +Assign a short name +.IR name +to a set of characters +.IR c1 , +.IR c2 ,\|.\|.\|.\& +so that they can be referred to from the other requests easily. +This is useful to assign properties to a large set of characters (using +.BR .cflags ). +. +.TP .BI .close\ stream Close the stream named .IR stream ;
Regards, -- Daiki Ueno