Follow-up Comment #31, bug #67571 (group groff): [comment #27 comment #27:] > Dave, > > You were right and I was wrong. Now that I found the right place to look, > it's clear to me that Werner intended to OR together all character flags that > "apply" to a `charinfo` of interest, and the only way that isn't a trivial > lookup on a `charinfo`'s `flags` member variable is by searching classes to > see if they contain the charinfo of interest (or, more precisely, its Unicode > code point).
If I'd looked even more carefully at that commit, like at the part that updated "ChangeLog", I'd have noticed that this wasn't Werner's design at all... diff --git a/ChangeLog b/ChangeLog index d59fd991b..e47e1a0b2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,37 @@ +2010-12-06 Colin Watson <[email protected]> + Daiki Ueno <[email protected]> + + 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 <vector> and <utility>. + (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. _______________________________________________________ Reply to this item at: <https://savannah.gnu.org/bugs/?67571> _______________________________________________ Message sent via Savannah https://savannah.gnu.org/
signature.asc
Description: PGP signature
