From 81d80a6f71cc6d6fbd3d1111498318fb22a6857a Mon Sep 17 00:00:00 2001 From: wl Date: Sat, 18 Dec 2010 09:13:16 +0000 Subject: Improve CJK support with new values for `.cflags'. This patch introduces three new values to `.cflags': don't break before character: 128 don't break after character: 256 allow inter-character break: 512 They are handled differently if compared to other cflags values: (1) hcode values are completely ignored (2) similar to kern values, and contrary to the other cflags values, troff looks at pairs of characters to decide whether a break gets inserted A yet-to-be-written patch should add inter-character spacing if those flags are active; currently, only zero-width breakpoints are inserted. * src/roff/troff/charinfo.h (charinfo): Change type of `flags' to `int'. Update callers accordingly. New enum values `DONT_BREAK_BEFORE', `DONT_BREAK_AFTER', and `INTER_CHAR_SPACE'. New member functions `prohibit_break_before', `prohibit_break_after', and `inter_char_space'. * src/roff/troff/input.cpp: Updated. * src/roff/troff/node.cpp (inter_char_space_node): New class similar to kern_pair_node, collecting charinfo entities with the abovementioned cflags values. (break_char_type): Add new enum values. (glyph_node::merge_glyph_node): Handle abovementioned cflags values and emit an `inter_char_space_node' if necessary. * tmac/ja.tmac: Use new cflags values. * doc/groff.texinfo, NEWS, man/groff_diff.man: Document new values. --- tmac/ja.tmac | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tmac') diff --git a/tmac/ja.tmac b/tmac/ja.tmac index d6883f8f..f0ecd75b 100644 --- a/tmac/ja.tmac +++ b/tmac/ja.tmac @@ -44,6 +44,6 @@ .class [CJKnormal] \ \[u3041]-\[u3096] \[u30A0]-\[u30FF] \[u4E00]-\[u9FFF] . -.cflags 2 \C'[CJKprepunct]' -.cflags 4 \C'[CJKpostpunct]' -.cflags 66 \C'[CJKnormal]' +.cflags 128 \C'[CJKprepunct]' +.cflags 266 \C'[CJKpostpunct]' +.cflags 512 \C'[CJKnormal]' -- cgit v1.2.1