From 34ed3608a03f7e2948a1820d78324f249d14026f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Tue, 11 Dec 2001 10:14:51 +0000 Subject: [PATCH] support for fraktur font in mathed git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3184 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/ChangeLog | 5 +++++ src/FontLoader.C | 5 +++++ src/lyxfont.C | 4 ++-- src/lyxfont.h | 2 ++ src/mathed/ChangeLog | 6 ++++++ src/mathed/math_data.h | 5 +++++ src/mathed/math_defs.h | 2 ++ src/mathed/math_hash.C | 1 + src/mathed/math_parser.C | 8 ++++---- src/mathed/math_support.C | 9 +++++++++ 10 files changed, 41 insertions(+), 6 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index d55f2671dc..6cb7b780cf 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2001-12-11 André Pönitz + + * FontLoader.C: + * lyxfont.[Ch]: support for fraktur font used by \mathfrak + 2001-12-06 John Levon * lyx_cb.C: another bv->text misuse, from insert label diff --git a/src/FontLoader.C b/src/FontLoader.C index 273aab3910..ae22435257 100644 --- a/src/FontLoader.C +++ b/src/FontLoader.C @@ -141,6 +141,11 @@ void FontLoader::getFontinfo(LyXFont::FONT_FAMILY family, new FontInfo("-*-msbm-*-*-*-*-*-*-*-*-*-*-*-*"); return; + case LyXFont::EUFRAK_FAMILY: + fontinfo[family][series][shape] = + new FontInfo("-*-eufrak-*-*-*-*-*-*-*-*-*-*-*-*"); + return; + default: break; } diff --git a/src/lyxfont.C b/src/lyxfont.C index f08de93fce..d10d487694 100644 --- a/src/lyxfont.C +++ b/src/lyxfont.C @@ -64,9 +64,9 @@ char const * GUIMiscNames[5] = // // Strings used to read and write .lyx format files // -char const * LyXFamilyNames[12] = +char const * LyXFamilyNames[LyXFont::NUM_FAMILIES + 2 /* default & error */] = { "roman", "sans", "typewriter", "symbol", - "cmr", "cmsy", "cmm", "cmex", "msa", "msb", + "cmr", "cmsy", "cmm", "cmex", "msa", "msb", "eufrak", "default", "error" }; char const * LyXSeriesNames[4] = diff --git a/src/lyxfont.h b/src/lyxfont.h index 9bf18307d4..5d75c20f2e 100644 --- a/src/lyxfont.h +++ b/src/lyxfont.h @@ -57,6 +57,8 @@ public: /// MSB_FAMILY, /// + EUFRAK_FAMILY, + /// INHERIT_FAMILY, /// IGNORE_FAMILY, diff --git a/src/mathed/ChangeLog b/src/mathed/ChangeLog index 93231de893..4910b9e724 100644 --- a/src/mathed/ChangeLog +++ b/src/mathed/ChangeLog @@ -1,3 +1,9 @@ +2001-12-11 André Pönitz + + * math_defs.h: + * math_parser.C: + * math_hash.C: support for \mathfrak + 2001-12-12 Angus Leeming * math_streamstr.C: #include to compile with DEC cxx diff --git a/src/mathed/math_data.h b/src/mathed/math_data.h index b537e51d70..86b8125eda 100644 --- a/src/mathed/math_data.h +++ b/src/mathed/math_data.h @@ -16,6 +16,7 @@ #ifndef MATH_DATA_H #define MATH_DATA_H +#include #include #include "math_atom.h" @@ -132,4 +133,8 @@ private: buffer_type bf_; }; +/// +std::ostream & operator<<(std::ostream & os, MathArray const & ar); + + #endif diff --git a/src/mathed/math_defs.h b/src/mathed/math_defs.h index a787878d85..adba3adb4e 100644 --- a/src/mathed/math_defs.h +++ b/src/mathed/math_defs.h @@ -44,6 +44,8 @@ enum MathTextCodes { /// LM_TC_CAL, /// + LM_TC_EUFRAK, + /// LM_TC_BF, // LM_TC_BB, diff --git a/src/mathed/math_hash.C b/src/mathed/math_hash.C index 40297fc953..cb86552258 100644 --- a/src/mathed/math_hash.C +++ b/src/mathed/math_hash.C @@ -92,6 +92,7 @@ key_type wordlist_array[] = {"mathbb", LM_TK_FONT, LM_TC_BB}, {"mathbf", LM_TK_FONT, LM_TC_BF}, {"mathcal", LM_TK_FONT, LM_TC_CAL}, + {"mathfrak", LM_TK_FONT, LM_TC_EUFRAK}, {"mathit", LM_TK_FONT, LM_TC_IT}, {"mathnormal", LM_TK_FONT, LM_TC_VAR}, {"mathrm", LM_TK_FONT, LM_TC_RM}, diff --git a/src/mathed/math_parser.C b/src/mathed/math_parser.C index f0b6e4fa99..fe3244226c 100644 --- a/src/mathed/math_parser.C +++ b/src/mathed/math_parser.C @@ -791,14 +791,14 @@ void Parser::parse_into(MathArray & array, unsigned flags, MathTextCodes code) else if (t.cat() == catEnd) { if (flags & FLAG_BRACE_LAST) return; - //lyxerr << "found '}' unexpectedly, array: '" << array << "'\n"; - lyxerr << "found '}' unexpectedly\n"; + lyxerr << "found '}' unexpectedly, array: '" << array << "'\n"; + //lyxerr << "found '}' unexpectedly\n"; add(array, '}', LM_TC_TEX); } else if (t.cat() == catAlign) { - //lyxerr << "found tab unexpectedly, array: '" << array << "'\n"; - lyxerr << "found tab unexpectedly\n"; + lyxerr << "found tab unexpectedly, array: '" << array << "'\n"; + //lyxerr << "found tab unexpectedly\n"; add(array, '&', LM_TC_TEX); } diff --git a/src/mathed/math_support.C b/src/mathed/math_support.C index 30f21f4ed5..3cc3cae92d 100644 --- a/src/mathed/math_support.C +++ b/src/mathed/math_support.C @@ -78,6 +78,7 @@ enum MathFont { FONT_CMEX, FONT_MSA, FONT_MSB, + FONT_EUFRAK, FONT_NUM }; @@ -117,6 +118,7 @@ void mathed_init_fonts() MathFonts[FONT_CMEX].setFamily(LyXFont::CMEX_FAMILY); MathFonts[FONT_MSA].setFamily(LyXFont::MSA_FAMILY); MathFonts[FONT_MSB].setFamily(LyXFont::MSB_FAMILY); + MathFonts[FONT_EUFRAK].setFamily(LyXFont::EUFRAK_FAMILY); for (int i = 0; i < LM_FONT_END; ++i) font_available_initialized[i] = false; @@ -182,6 +184,12 @@ LyXFont const & whichFontBase(MathTextCodes type) case LM_TC_MSB: return MathFonts[FONT_MSB]; + case LM_TC_EUFRAK: + if (math_font_available(LM_TC_EUFRAK)) + return MathFonts[FONT_EUFRAK]; + else + return MathFonts[FONT_BB]; + default: break; } @@ -744,6 +752,7 @@ char const * math_font_name(MathTextCodes code) static char const * theFontNames[] = { "mathrm", "mathcal", + "mathfrak", "mathbf", "mathbb", "mathsf",