From d5d8909e11e0c613f7a1dfba3a20a405ae7b4da4 Mon Sep 17 00:00:00 2001 From: wl Date: Mon, 13 Dec 2010 15:30:19 +0000 Subject: Implement support for character classes. This patch uses standard C++ headers, contrary to the rest of groff. Ideally, everything in groff should be updated to do the same. * src/include/font.h (glyph_to_unicode): New function. * src/libs/libgroff/font.cpp (glyph_to_unicode): Implement it. (font::contains, font::get_code): Use it. * src/roff/troff/charinfo.h: Include and . (charinfo): New members `ranges' and `nested_classes'. New member functions `get_unicode_code' and `get_flags'. New member functions `add_to_class', `is_class', and `contains'. (charinfo::overlaps_horizontally, charinfo::overlaps_vertically, charinfo::can_break_before, charinfo::can_break_after, charinfo::can_break_after, charinfo::ends_sentence, charinfo::transparent,, charinfo:ignore_hcodes): Use `get_flags', which handles character classes also. * src/roff/troff/input.cpp (char_class_dictionary): New global variable. (define_class): New function. (init_input_requests): Register `class'. (charinfo::get_unicode_code, charinfo::get_flags, charinfo::contains): Implement it. * NEWS, doc/groff.texinfo (Character Classes), man/groff_diff.man, man/groff.man: Document it. --- NEWS | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'NEWS') diff --git a/NEWS b/NEWS index c5028c4b..00a41b47 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 assigns a short name to a set of characters + which can be referred to in the `cflags' request. This is especially + useful to control line-breaking and hyphenation rules in CJK languages. + Tbl --- -- cgit v1.2.1