#define LYXFONT_H
#include "LColor.h"
+#include "support/docstream.h"
+
+
+namespace lyx {
-#include <iosfwd>
-#include <string>
class LyXLex;
class BufferParams;
///
WASY_FAMILY,
///
+ ESINT_FAMILY,
+ ///
INHERIT_FAMILY,
///
IGNORE_FAMILY,
///
LColor_color color() const;
///
- Language const * language() const;
+ Language const * language() const { return lang; }
///
bool isRightToLeft() const;
///
to this font. Returns number of chars written. Base is the
font state active now.
*/
- int latexWriteStartChanges(std::ostream &, LyXFont const & base,
+ int latexWriteStartChanges(odocstream &, LyXFont const & base,
LyXFont const & prev) const;
/** Writes the tail of the LaTeX needed to change to this font.
Returns number of chars written. Base is the font state we want
to achieve.
*/
- int latexWriteEndChanges(std::ostream &, LyXFont const & base,
+ int latexWriteEndChanges(odocstream &, LyXFont const & base,
LyXFont const & next) const;
/// Build GUI description of font state
std::ostream & operator<<(std::ostream & os, LyXFont const & font);
/// Converts logical attributes to concrete shape attribute
- LyXFont::FONT_SHAPE realShape() const;
+ // Try hard to inline this as it shows up with 4.6 % in the profiler.
+ LyXFont::FONT_SHAPE realShape() const {
+ if (bits.noun == ON)
+ return SMALLCAPS_SHAPE;
+ if (bits.emph == ON)
+ return (bits.shape == UP_SHAPE) ? ITALIC_SHAPE : UP_SHAPE;
+ return bits.shape;
+ }
+
/** Compaq cxx 6.5 requires that the definition be public so that
it can compile operator==()
case LyXFont::MSA_FAMILY:
case LyXFont::MSB_FAMILY:
case LyXFont::WASY_FAMILY:
+ case LyXFont::ESINT_FAMILY:
return true;
default:
return false;
return !(font1 == font2);
}
+
+} // namespace lyx
+
#endif