summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorwl <wl>2008-01-16 16:08:47 +0000
committerwl <wl>2008-01-16 16:08:47 +0000
commitd4810e5dd58431beef467e9899caf2b17e786d15 (patch)
treed0b3ab62afc3469e1985d17e3b5d4b40c863305a /src
parent107782b8de0b800b2a110ea861e6b624ba57c68c (diff)
downloadgroff-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.
Diffstat (limited to 'src')
-rw-r--r--src/libs/libgroff/font.cpp14
1 files changed, 13 insertions, 1 deletions
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) {