2006-10-15 21:47:29 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/**
|
|
|
|
* \file NoGuiFontMetrics.h
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
*
|
|
|
|
* \author Abdelrazak Younes
|
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef LYX_NO_GUI_FONT_METRICS_H
|
|
|
|
#define LYX_NO_GUI_FONT_METRICS_H
|
|
|
|
|
|
|
|
#include "frontends/FontMetrics.h"
|
|
|
|
|
2007-04-26 04:41:58 +00:00
|
|
|
#include "Dimension.h"
|
2006-12-04 10:33:47 +00:00
|
|
|
|
2007-11-13 23:00:36 +00:00
|
|
|
#include "support/strfwd.h"
|
2006-10-15 21:47:29 +00:00
|
|
|
|
|
|
|
namespace lyx {
|
|
|
|
namespace frontend {
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
class NoGuiFontMetrics : public FontMetrics
|
2006-10-15 21:47:29 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
NoGuiFontMetrics() {}
|
|
|
|
|
|
|
|
virtual ~NoGuiFontMetrics() {}
|
|
|
|
|
|
|
|
virtual int maxAscent() const { return 1; }
|
|
|
|
|
|
|
|
virtual int maxDescent() const { return 1; }
|
2007-05-28 22:27:45 +00:00
|
|
|
|
2006-12-04 10:33:47 +00:00
|
|
|
virtual Dimension const defaultDimension() const { return Dimension(1, 1, 1); }
|
|
|
|
|
2006-12-01 16:12:24 +00:00
|
|
|
virtual int width(char_type) const { return 1; }
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
virtual int ascent(char_type) const { return 1; }
|
2007-05-28 22:27:45 +00:00
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
int descent(char_type) const { return 1; }
|
2007-05-28 22:27:45 +00:00
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
virtual int lbearing(char_type) const { return 1; }
|
2007-05-28 22:27:45 +00:00
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
virtual int rbearing(char_type) const { return 1; }
|
2007-05-28 22:27:45 +00:00
|
|
|
|
2007-02-26 15:13:08 +00:00
|
|
|
virtual int width(docstring const & s) const { return s.size(); }
|
2007-05-28 22:27:45 +00:00
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
virtual int signedWidth(docstring const & s) const
|
2006-10-15 21:47:29 +00:00
|
|
|
{
|
2006-10-21 00:16:43 +00:00
|
|
|
if (s.size() && s[0] == '-')
|
2007-02-26 15:13:08 +00:00
|
|
|
return -width(s.substr(1, s.length() - 1));
|
|
|
|
return width(s);
|
2006-10-15 21:47:29 +00:00
|
|
|
}
|
2007-05-28 22:27:45 +00:00
|
|
|
|
2006-12-07 17:48:38 +00:00
|
|
|
virtual Dimension const dimension(char_type) const { return Dimension(1, 1, 1); }
|
2006-12-04 10:33:47 +00:00
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
virtual void rectText(docstring const &,
|
|
|
|
int & /*width*/, int & /*ascent*/, int & /*descent*/) const {}
|
2007-05-28 22:27:45 +00:00
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
virtual void buttonText(docstring const &,
|
|
|
|
int & /*width*/, int & /*ascent*/, int & /*descent*/) const {}
|
2006-10-15 21:47:29 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace frontend
|
|
|
|
} // namespace lyx
|
|
|
|
|
|
|
|
#endif // LYX_NO_GUI_FONT_METRICS_H
|