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>
* BufferView_pimpl.C: apply John's patch for #93.

View File

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

View File

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

View File

@ -41,7 +41,7 @@ namespace {
char const * GUIFamilyNames[LyXFont::NUM_FAMILIES + 2 /* default & error */] =
{ 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") };
char const * GUISeriesNames[4] =
@ -65,7 +65,7 @@ char const * GUIMiscNames[5] =
//
char const * LyXFamilyNames[LyXFont::NUM_FAMILIES + 2 /* default & error */] =
{ "roman", "sans", "typewriter", "symbol",
"cmr", "cmsy", "cmm", "cmex", "msa", "msb", "eufrak",
"cmr", "cmsy", "cmm", "cmex", "msa", "msb", "eufrak", "wasy",
"default", "error" };
char const * LyXSeriesNames[4] =

View File

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

View File

@ -55,3 +55,9 @@ void MathBraceInset::normalize(NormalStream & os) const
{
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 metrics(MathMetricsInfo & mi) const;
///
void MathBraceInset::infoize(std::ostream & os) const;
private:
/// width of brace character

View File

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

View File

@ -193,6 +193,7 @@ void MathHullInset::metrics(MathMetricsInfo & mi) const
// for markers
width_ += 2;
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},
{"msa", LyXFont::MSA_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},
{"textbf", inh_family, LyXFont::BOLD_SERIES, inh_shape, LColor::black},
{"textit", inh_family, inh_series, LyXFont::ITALIC_SHAPE, LColor::black},