+/* This file is part of
+ * ======================================================
+ *
+ * LyX, The Document Processor
+ *
+ * Copyright 1995 Matthias Ettrich
+ * Copyright 1995-2000 The LyX Team.
+ *
+ * ====================================================== */
+
#include <config.h>
+#ifdef __GNUG__
+#pragma implementation
+#endif
+
#include <cctype>
#include "font.h"
if (lyxrc.font_norm_type == LyXRC::ISO_10646_1) {
XChar2b * xs = new XChar2b[n];
- Encoding const * enc = f.language()->encoding();
+ Encoding const * encoding = f.language()->encoding();
+ LyXFont const * font = &f;
+ if (f.family() == LyXFont::SYMBOL_FAMILY) {
+#ifdef USE_UNICODE_FOR_SYMBOLS
+ LyXFont font2 = f;
+ font2.setFamily(LyXFont::ROMAN_FAMILY);
+ font2.setShape(LyXFont::UP_SHAPE);
+ font = &font2;
+#endif
+ encoding = &symbol_encoding;
+ }
for (int i = 0; i < n; ++i) {
- Uchar c = enc->ucs(s[i]);
+ Uchar c = encoding->ucs(s[i]);
xs[i].byte1 = c >> 8;
xs[i].byte2 = c & 0xff;
}
- int result = width(xs, n, f);
+ int result = width(xs, n, *font);
delete[] xs;
return result;
}