*
* Copyright (C) 1995 Matthias Ettrich
*
- *======================================================*/
-#ifndef _LYXFONT_H
-#define _LYXFONT_H
+ * ====================================================== */
+
+#ifndef LYXFONT_H
+#define LYXFONT_H
#ifdef __GNUG__
#pragma interface
#include FORMS_H_LOCATION
#include "LString.h"
+#include "debug.h"
// It might happen that locale.h defines ON and OFF. This is not good
// for us, since we use these names below. But of course this is due
/// Shortcut initialization
LyXFont(LyXFont::FONT_INIT3);
- /// LyXFont x,y; x=y;
+ /// LyXFont x, y; x = y;
LyXFont& operator=(LyXFont const & x);
/// Decreases font size by one
LyXFont & setColor(LyXFont::FONT_COLOR c);
/// Set family after LyX text format
- LyXFont & setLyXFamily(LString const &);
+ LyXFont & setLyXFamily(string const &);
/// Set series after LyX text format
- LyXFont & setLyXSeries(LString const &);
+ LyXFont & setLyXSeries(string const &);
/// Set shape after LyX text format
- LyXFont & setLyXShape(LString const &);
+ LyXFont & setLyXShape(string const &);
/// Set size after LyX text format
- LyXFont & setLyXSize(LString const &);
+ LyXFont & setLyXSize(string const &);
/// Returns misc flag after LyX text format
- LyXFont::FONT_MISC_STATE setLyXMisc(LString const &);
+ LyXFont::FONT_MISC_STATE setLyXMisc(string const &);
/// Sets color after LyX text format
- LyXFont & setLyXColor(LString const &);
+ LyXFont & setLyXColor(string const &);
/// Sets size after GUI name
- LyXFont & setGUISize(LString const &);
+ LyXFont & setGUISize(string const &);
/// Returns size of font in LaTeX text notation
- LString latexSize() const;
+ string 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
+ * 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, bool toggleall=false);
+ void update(LyXFont const & newfont, bool toggleall = false);
/** Reduce font to fall back to template where possible.
Equal fields are reduced to INHERIT */
*/
int latexWriteStartChanges(FILE *, LyXFont const & base) const;
- /** Writes to LString, the head of the LaTeX needed to change
+ /** Writes to string, the head of the LaTeX needed to change
to this font. Returns number of chars written. Base is the
font state active now.
*/
- int latexWriteStartChanges(LString &, LyXFont const & base) const;
+ int latexWriteStartChanges(string &, LyXFont const & base) const;
/** Writes the tail of the LaTeX needd to change to this font.
Returns number of chars written. Base is the font state we want
Returns number of chars written. Base is the font state we want
to achieve.
*/
- int latexWriteEndChanges(LString &, LyXFont const & base) const;
+ int latexWriteEndChanges(string &, LyXFont const & base) const;
/// Build GUI description of font state
- LString stateText() const;
+ string stateText() const;
///
int maxAscent() const;
int textWidth(char const *s, int n) const;
///
- int stringWidth(LString const & s) const;
+ int stringWidth(string const & s) const;
///
- int signedStringWidth(LString const & s) const;
+ int signedStringWidth(string const & s) const;
/// Draws text and returns width of text
int drawText(char const*, int n, Pixmap, int baseline, int x) const;
///
- int drawString(LString const &, Pixmap pm, int baseline, int x) const;
+ int drawString(string const &, Pixmap pm, int baseline, int x) const;
///
GC getGC() const;
XFontStruct* getXFontstruct() const;
};
+ostream & operator<<(ostream &, LyXFont::FONT_MISC_STATE);
inline LyXFont::LyXFont()
{