support for wasy symbols

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4566 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
André Pönitz 2002-07-09 13:38:27 +00:00
parent b23d2ad302
commit 2c3ae20fc2
10 changed files with 50 additions and 22 deletions

View File

@ -1,4 +1,8 @@
2002-07-09 André Pönitz <poenitz@gmx.net>
* lyxfont.[Ch]: support for wasy symbols
2002-07-08 André Pönitz <poenitz@gmx.net> 2002-07-08 André Pönitz <poenitz@gmx.net>
* BufferView_pimpl.C: apply John's patch for #93. * BufferView_pimpl.C: apply John's patch for #93.

View File

@ -141,7 +141,8 @@ char const * simplefeatures[] = {
"floatflt", "floatflt",
"varioref", "varioref",
"prettyref", "prettyref",
"float" "float",
"wasy"
}; };
const int nb_simplefeatures = sizeof(simplefeatures) / sizeof(char const *); const int nb_simplefeatures = sizeof(simplefeatures) / sizeof(char const *);
@ -154,21 +155,20 @@ string const LaTeXFeatures::getPackages() const
LyXTextClass const & tclass = textclasslist[params.textclass]; LyXTextClass const & tclass = textclasslist[params.textclass];
/** //
* These are all the 'simple' includes. i.e // These are all the 'simple' includes. i.e
* packages which we just \usepackage{package} // packages which we just \usepackage{package}
**/ //
for (int i = 0 ; i < nb_simplefeatures ; ++i) { for (int i = 0; i < nb_simplefeatures; ++i) {
if (isRequired(simplefeatures[i])) if (isRequired(simplefeatures[i]))
packages << "\\usepackage{" packages << "\\usepackage{"
<< simplefeatures[i] << simplefeatures[i] << "}\n";
<< "}\n";
} }
/** //
* The rest of these packages are somewhat more complicated // The rest of these packages are somewhat more complicated
* than those above. // than those above.
**/ //
if (isRequired("amsmath") if (isRequired("amsmath")
&& ! tclass.provides(LyXTextClass::amsmath)) { && ! tclass.provides(LyXTextClass::amsmath)) {

View File

@ -147,6 +147,11 @@ void xfont_loader::getFontinfo(LyXFont::FONT_FAMILY family,
new FontInfo("-*-eufm10-medium-*-*-*-*-*-*-*-*-*-*-*"); new FontInfo("-*-eufm10-medium-*-*-*-*-*-*-*-*-*-*-*");
return; return;
case LyXFont::WASY_FAMILY:
fontinfo[family][series][shape] =
new FontInfo("-*-wasy10-medium-*-*-*-*-*-*-*-*-*-*-*");
return;
default: default:
break; break;
} }

View File

@ -41,7 +41,7 @@ namespace {
char const * GUIFamilyNames[LyXFont::NUM_FAMILIES + 2 /* default & error */] = char const * GUIFamilyNames[LyXFont::NUM_FAMILIES + 2 /* default & error */] =
{ N_("Roman"), N_("Sans serif"), N_("Typewriter"), N_("Symbol"), { N_("Roman"), N_("Sans serif"), N_("Typewriter"), N_("Symbol"),
"cmr", "cmsy", "cmm", "cmex", "msa", "msb", "eufrak", "cmr", "cmsy", "cmm", "cmex", "msa", "msb", "eufrak", "wasy",
N_("Inherit"), N_("Ignore") }; N_("Inherit"), N_("Ignore") };
char const * GUISeriesNames[4] = char const * GUISeriesNames[4] =
@ -65,7 +65,7 @@ char const * GUIMiscNames[5] =
// //
char const * LyXFamilyNames[LyXFont::NUM_FAMILIES + 2 /* default & error */] = char const * LyXFamilyNames[LyXFont::NUM_FAMILIES + 2 /* default & error */] =
{ "roman", "sans", "typewriter", "symbol", { "roman", "sans", "typewriter", "symbol",
"cmr", "cmsy", "cmm", "cmex", "msa", "msb", "eufrak", "cmr", "cmsy", "cmm", "cmex", "msa", "msb", "eufrak", "wasy",
"default", "error" }; "default", "error" };
char const * LyXSeriesNames[4] = char const * LyXSeriesNames[4] =

View File

@ -59,6 +59,8 @@ public:
/// ///
EUFRAK_FAMILY, EUFRAK_FAMILY,
/// ///
WASY_FAMILY,
///
INHERIT_FAMILY, INHERIT_FAMILY,
/// ///
IGNORE_FAMILY, IGNORE_FAMILY,
@ -425,6 +427,7 @@ bool LyXFont::isSymbolFont() const
case LyXFont::CMEX_FAMILY: case LyXFont::CMEX_FAMILY:
case LyXFont::MSA_FAMILY: case LyXFont::MSA_FAMILY:
case LyXFont::MSB_FAMILY: case LyXFont::MSB_FAMILY:
case LyXFont::WASY_FAMILY:
return true; return true;
default: default:
return false; return false;

View File

@ -55,3 +55,9 @@ void MathBraceInset::normalize(NormalStream & os) const
{ {
os << "[block " << cell(0) << ']'; os << "[block " << cell(0) << ']';
} }
void MathBraceInset::infoize(std::ostream & os) const
{
os << "Nested Block: ";
}

View File

@ -29,6 +29,8 @@ public:
void normalize(NormalStream & ns) const; void normalize(NormalStream & ns) const;
/// ///
void metrics(MathMetricsInfo & mi) const; void metrics(MathMetricsInfo & mi) const;
///
void MathBraceInset::infoize(std::ostream & os) const;
private: private:
/// width of brace character /// width of brace character

View File

@ -727,6 +727,7 @@ void MathCursor::getPos(int & x, int & y)
if (array().empty()) if (array().empty())
x += 2; x += 2;
y = xarray().yo(); y = xarray().yo();
lyxerr << "getPos: " << x << " " << y << "\n";
} }
@ -768,7 +769,7 @@ MathCursor::pos_type & MathCursor::pos()
MathUnknownInset * MathCursor::inMacroMode() const MathUnknownInset * MathCursor::inMacroMode() const
{ {
if (pos() == 0) if (!hasPrevAtom())
return 0; return 0;
MathUnknownInset * p = prevAtom()->asUnknownInset(); MathUnknownInset * p = prevAtom()->asUnknownInset();
return (p && !p->final()) ? p : 0; return (p && !p->final()) ? p : 0;
@ -1444,10 +1445,15 @@ bool MathCursor::interpret(char c)
return true; return true;
} }
// leave autocorrect mode if necessary // This is annoying as one has to press <space> far too often.
if (autocorrect_ && c == ' ') { // Disable it.
autocorrect_ = false;
return true; if (0) {
// leave autocorrect mode if necessary
if (autocorrect_ && c == ' ') {
autocorrect_ = false;
return true;
}
} }
// just clear selection on pressing the space bar // just clear selection on pressing the space bar
@ -1536,8 +1542,8 @@ bool MathCursor::interpret(char c)
*/ */
// try auto-correction // try auto-correction
if (autocorrect_ && hasPrevAtom() && math_autocorrect(prevAtom(), c)) //if (autocorrect_ && hasPrevAtom() && math_autocorrect(prevAtom(), c))
return true; // return true;
// no special circumstances, so insert the character without any fuss // no special circumstances, so insert the character without any fuss
insert(c); insert(c);

View File

@ -193,6 +193,7 @@ void MathHullInset::metrics(MathMetricsInfo & mi) const
// for markers // for markers
width_ += 2; width_ += 2;
descent_ += 1; descent_ += 1;
ascent_ += 1;
} }
@ -210,7 +211,7 @@ void MathHullInset::draw(MathPainterInfo & pi, int x, int y) const
} }
} }
drawMarkers(pi, x, y); drawMarkers2(pi, x, y);
} }

View File

@ -554,6 +554,7 @@ fontinfo fontinfos[] = {
{"eufrak", LyXFont::EUFRAK_FAMILY, inh_series, inh_shape, LColor::math}, {"eufrak", LyXFont::EUFRAK_FAMILY, inh_series, inh_shape, LColor::math},
{"msa", LyXFont::MSA_FAMILY, inh_series, inh_shape, LColor::math}, {"msa", LyXFont::MSA_FAMILY, inh_series, inh_shape, LColor::math},
{"msb", LyXFont::MSB_FAMILY, inh_series, inh_shape, LColor::math}, {"msb", LyXFont::MSB_FAMILY, inh_series, inh_shape, LColor::math},
{"wasy", LyXFont::WASY_FAMILY, inh_series, inh_shape, LColor::math},
{"text", inh_family, inh_series, inh_shape, LColor::black}, {"text", inh_family, inh_series, inh_shape, LColor::black},
{"textbf", inh_family, LyXFont::BOLD_SERIES, inh_shape, LColor::black}, {"textbf", inh_family, LyXFont::BOLD_SERIES, inh_shape, LColor::black},
{"textit", inh_family, inh_series, LyXFont::ITALIC_SHAPE, LColor::black}, {"textit", inh_family, inh_series, LyXFont::ITALIC_SHAPE, LColor::black},