diff options
author | wl <wl> | 2008-01-16 16:08:47 +0000 |
---|---|---|
committer | wl <wl> | 2008-01-16 16:08:47 +0000 |
commit | d4810e5dd58431beef467e9899caf2b17e786d15 (patch) | |
tree | d0b3ab62afc3469e1985d17e3b5d4b40c863305a | |
parent | 107782b8de0b800b2a110ea861e6b624ba57c68c (diff) | |
download | groff-d4810e5dd58431beef467e9899caf2b17e786d15.tar.gz |
* src/libs/libgroff/font.cpp (font::contains, font::get_code):
Handle single-letter names correctly.
* doc/groff.texinfo, man/groff_diff.man: Extend documentation of \^
and \|.
* NEWS: Updated.
-rw-r--r-- | ChangeLog | 17 | ||||
-rw-r--r-- | NEWS | 10 | ||||
-rw-r--r-- | doc/groff.texinfo | 8 | ||||
-rw-r--r-- | man/groff_diff.man | 13 | ||||
-rw-r--r-- | src/libs/libgroff/font.cpp | 14 |
5 files changed, 58 insertions, 4 deletions
@@ -1,3 +1,16 @@ +2008-01-16 Werner LEMBERG <wl@gnu.org> + + * src/libs/libgroff/font.cpp (font::contains, font::get_code): + Handle single-letter names correctly. + + * doc/groff.texinfo, man/groff_diff.man: Extend documentation of \^ + and \|. + * NEWS: Updated. + +2008-01-15 Werner LEMBERG <wl@gnu.org> + + * man/groff_font.man: Revised. + 2008-01-14 Werner LEMBERG <wl@gnu.org> * man/groff.man: Mention glyph and characters. @@ -1093,7 +1106,7 @@ 2006-10-26 Werner LEMBERG <wl@gnu.org> - Add `\%^' escape to handle the parameters to a macro as a string + Add `\$^' escape to handle the parameters to a macro as a string argument. * src/roff/troff/input.h (DOUBLE_QUOTE): New special character. @@ -1106,7 +1119,7 @@ Update constructor and all callers. (decode_args): Store discarded double quotes. (interpolate_args): Handle DOUBLE_QUOTE. - Add `\%^' escape. + Add `\$^' escape. (get_copy, token::next, composite_glyph_name): Handle DOUBLE_QUOTE. * tmac/trace.tmac: Trace .nr, .ds, .ds1, .as, .as1. @@ -1,4 +1,4 @@ - Copyright (C) 1989-2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 + Copyright (C) 1989-2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, @@ -68,6 +68,14 @@ o A new escape `\$^' has been added. It represents the parameters of a o A new read-only number register `.O' is available which returns the current suppression level as set by the `\O' escape. + +o The space width emitted by the `\|' and `\^' escape sequences can be + controlled on a per-font basis. If there is a glyph named `\|' or `\^', + respectively (note the leading backslash), defined in the current font + file, use this glyph's width instead of the default value. + + This behaviour is not new, but hasn't been documented before. + Nroff ----- diff --git a/doc/groff.texinfo b/doc/groff.texinfo index 9dd49d0b..f7cd5de9 100644 --- a/doc/groff.texinfo +++ b/doc/groff.texinfo @@ -11485,11 +11485,19 @@ when a line is adjusted. @Defesc {\\|, , , } A 1/6@dmn{th} em space. Ignored for TTY output devices (rounded to zero). + +However, if there is a glyph defined in the current font file with name +@code{\|} (note the leading backslash), the width of this glyph is used +instead (even for TTYs). @endDefesc @Defesc {\\^, , , } A 1/12@dmn{th} em space. Ignored for TTY output devices (rounded to zero). + +However, if there is a glyph defined in the current font file with name +@code{\^} (note the leading backslash), the width of this glyph is used +instead (even for TTYs). @endDefesc @Defesc {\\0, , , } diff --git a/man/groff_diff.man b/man/groff_diff.man index 1477f864..fb3121b8 100644 --- a/man/groff_diff.man +++ b/man/groff_diff.man @@ -3161,6 +3161,19 @@ request can now map characters onto .BR \[rs]~ . . .P +The space width emitted by the +.B \[rs]| +and +.B \[rs]^ +escape sequences can be controlled on a per-font basis. +If there is a glyph named +.B \[rs]| +or +.BR \[rs]^ , +respectively (note the leading backslash), defined in the current font file, +use this glyph's width instead of the default value. +. +.P It is now possible to have whitespace between the first and second dot (or the name of the ending macro) to end a macro definition. . diff --git a/src/libs/libgroff/font.cpp b/src/libs/libgroff/font.cpp index 6e82de64..7254aafa 100644 --- a/src/libs/libgroff/font.cpp +++ b/src/libs/libgroff/font.cpp @@ -1,6 +1,6 @@ // -*- C++ -*- /* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2003, 2004, 2005, - 2006 + 2006, 2008 Free Software Foundation, Inc. Written by James Clark (jjc@jclark.com) @@ -292,6 +292,12 @@ int font::contains(glyph *g) // Unicode character? if (check_unicode_name(nm)) return 1; + // If `nm' is a single letter `x', the glyph name is `\x'. + char buf[] = { '\\', '\0', '\0' }; + if (nm[1] == '\0') { + buf[1] = nm[0]; + nm = buf; + } // groff glyph name that maps to Unicode? const char *unicode = glyph_name_to_unicode(nm); if (unicode != NULL && strchr(unicode, '_') == NULL) @@ -573,6 +579,12 @@ int font::get_code(glyph *g) char *ignore; return (int)strtol(nm + 1, &ignore, 16); } + // If `nm' is a single letter `x', the glyph name is `\x'. + char buf[] = { '\\', '\0', '\0' }; + if (nm[1] == '\0') { + buf[1] = nm[0]; + nm = buf; + } // groff glyphs that map to Unicode? const char *unicode = glyph_name_to_unicode(nm); if (unicode != NULL && strchr(unicode, '_') == NULL) { |