///
LyXFont();
- /// LyXFont x(LyXFont ...) and LyXFont x = LyXFont ...
+ // LyXFont x(LyXFont ...) and LyXFont x = LyXFont ...
LyXFont(LyXFont const & x);
/// Shortcut initialization
///
FONT_MISC_STATE latex() const;
+ ///
+ FONT_MISC_STATE number() const;
+
///
LColor::color color() const;
///
LyXFont & setLatex(LyXFont::FONT_MISC_STATE l);
///
+ LyXFont & setNumber(LyXFont::FONT_MISC_STATE n);
+ ///
LyXFont & setColor(LColor::color c);
///
LyXFont & setLanguage(Language const * l);
/// Sets color after LyX text format
LyXFont & setLyXColor(string const &);
-
+
+#if 0
/// Sets size after GUI name
LyXFont & setGUISize(string const &);
-
+#endif
+
/// Returns size of font in LaTeX text notation
- string latexSize() const;
+ string const latexSize() const;
- /** Updates font settings according to request. If an
- attribute is IGNORE, the attribute is left as it is. */
- /*
- * When toggleall = true, all properties that matches the font in use
- * will have the effect that the properties is reset to the
- * default. If we have a text that is TYPEWRITER_FAMILY, and is
- * update()'ed with TYPEWRITER_FAMILY, the operation will be as if
- * a INHERIT_FAMILY was asked for. This is necessary for the
- * toggle-user-defined-style button on the toolbar.
- */
+ /** Updates font settings according to request.
+ If an attribute is IGNORE, the attribute is left as it is.
+ When toggleall = true, all properties that matches the font in use
+ will have the effect that the properties is reset to the
+ default. If we have a text that is TYPEWRITER_FAMILY, and is
+ update()'ed with TYPEWRITER_FAMILY, the operation will be as if
+ a INHERIT_FAMILY was asked for. This is necessary for the
+ toggle-user-defined-style button on the toolbar.
+ */
void update(LyXFont const & newfont,
Language const * default_lang,
bool toggleall = false);
LyXFont const & next) const;
/// Build GUI description of font state
- string stateText(BufferParams * params) const;
+ string const stateText(BufferParams * params) const;
///
LColor::color realColor() const;
///
friend
- bool operator==(LyXFont const & font1, LyXFont const & font2) {
- return font1.bits == font2.bits &&
- font1.lang == font2.lang;
- }
+ bool operator==(LyXFont const & font1, LyXFont const & font2);
///
friend
- bool operator!=(LyXFont const & font1, LyXFont const & font2) {
- return !(font1 == font2);
- }
+ bool operator!=(LyXFont const & font1, LyXFont const & font2);
/// compares two fonts, ignoring the setting of the Latex part.
bool equalExceptLatex(LyXFont const &) const;
FontBits bits;
///
Language const * lang;
+ ///
+ FONT_MISC_STATE number_;
/// Sane font
static FontBits sane;
LyXFont::FONT_MISC_STATE org);
};
-
+///
std::ostream & operator<<(std::ostream &, LyXFont::FONT_MISC_STATE);
+///
+inline
+bool operator==(LyXFont const & font1, LyXFont const & font2) {
+ return font1.bits == font2.bits &&
+ font1.lang == font2.lang &&
+ font1.number_ == font2.number_;
+}
+
+///
+inline
+bool operator!=(LyXFont const & font1, LyXFont const & font2) {
+ return !(font1 == font2);
+}
+
inline
LyXFont::LyXFont()
{
bits = sane;
lang = default_language;
+ number_ = OFF;
}
{
bits = x.bits;
lang = x.lang;
+ number_ = x.number_;
}
{
bits = inherit;
lang = default_language;
+ number_ = OFF;
}
{
bits = ignore;
lang = ignore_language;
+ number_ = IGNORE;
}
{
bits = sane;
lang = default_language;
+ number_ = OFF;
}
+
+
inline
LyXFont::LyXFont(LyXFont::FONT_INIT1, Language const * l)
{
bits = inherit;
lang = l;
+ number_ = OFF;
}
{
bits = ignore;
lang = l;
+ number_ = IGNORE;
}
{
bits = sane;
lang = l;
+ number_ = OFF;
}
{
bits = x.bits;
lang = x.lang;
+ number_ = x.number_;
return *this;
}
}
+inline
+LyXFont::FONT_MISC_STATE LyXFont::number() const
+{
+ return number_;
+}
+
+
inline
bool LyXFont::isRightToLeft() const
{
inline
bool LyXFont::isVisibleRightToLeft() const
{
- return (lang->RightToLeft() && latex() != ON);
+ return (lang->RightToLeft() && latex() != ON && number() != ON);
}
return *this;
}
+
+inline
+LyXFont & LyXFont::setNumber(LyXFont::FONT_MISC_STATE n)
+{
+ number_ = n;
+ return *this;
+}
+
#endif