Diffstat (limited to 'noncore/apps/opie-reader/FontControl.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-reader/FontControl.h | 178 |
1 files changed, 89 insertions, 89 deletions
diff --git a/noncore/apps/opie-reader/FontControl.h b/noncore/apps/opie-reader/FontControl.h index 5681496..e56b619 100644 --- a/noncore/apps/opie-reader/FontControl.h +++ b/noncore/apps/opie-reader/FontControl.h @@ -22,16 +22,16 @@ class FontControl FontControl(QString n = "helvetica", int size = 10) - : - m_fontsizes(NULL), m_hasCourier(false), m_leading(0), m_extraspace(0) + : + m_fontsizes(NULL), m_hasCourier(false), m_leading(0), m_extraspace(0) { - ChangeFont(n, size); + ChangeFont(n, size); } ~FontControl() - { - if (m_fontsizes != NULL) delete [] m_fontsizes; - } + { + if (m_fontsizes != NULL) delete [] m_fontsizes; + } void hasCourier(bool _b, const QString& _nm) - { - m_hasCourier = _b; - m_fixedfontname = _nm; - } + { + m_hasCourier = _b; + m_fixedfontname = _nm; + } QString& fixedfontname() { return m_fixedfontname; } @@ -41,19 +41,19 @@ class FontControl int getsize(const CStyle& size) - { - int tgt = m_size+size.getFontSize(); - if (tgt < 0) - { - tgt = 0; - } - if (tgt >= m_maxsize) - { - tgt = m_maxsize - 1; - } - return m_fontsizes[tgt]; - } + { + int tgt = m_size+size.getFontSize(); + if (tgt < 0) + { + tgt = 0; + } + if (tgt >= m_maxsize) + { + tgt = m_maxsize - 1; + } + return m_fontsizes[tgt]; + } int ascent() { - QFont f(name(), currentsize()); - QFontMetrics fm(f); - return fm.ascent(); + QFont f(name(), currentsize()); + QFontMetrics fm(f); + return fm.ascent(); } @@ -61,5 +61,5 @@ class FontControl { - QFont f(name(), getsize(ch)); - QFontMetrics fm(f); - return fm.ascent(); + QFont f(name(), getsize(ch)); + QFontMetrics fm(f); + return fm.ascent(); } @@ -67,5 +67,5 @@ class FontControl { - QFont f(name(), currentsize()); - QFontMetrics fm(f); - return fm.descent(); + QFont f(name(), currentsize()); + QFontMetrics fm(f); + return fm.descent(); } @@ -73,5 +73,5 @@ class FontControl { - QFont f(name(), getsize(ch)); - QFontMetrics fm(f); - return fm.descent(); + QFont f(name(), getsize(ch)); + QFontMetrics fm(f); + return fm.descent(); } @@ -79,5 +79,5 @@ class FontControl { - QFont f(name(), currentsize()); - QFontMetrics fm(f); - return fm.lineSpacing(); + QFont f(name(), currentsize()); + QFontMetrics fm(f); + return fm.lineSpacing(); } @@ -85,67 +85,67 @@ class FontControl { - QFont f(name(), getsize(ch)); - QFontMetrics fm(f); - return fm.lineSpacing(); + QFont f(name(), getsize(ch)); + QFontMetrics fm(f); + return fm.lineSpacing(); } bool decreasesize() - { + { /* - if (--m_size < 0) - { - m_size = 0; - return false; - } - else return true; + if (--m_size < 0) + { + m_size = 0; + return false; + } + else return true; */ - if (g_size-- == m_size) - { - if (--m_size < 0) - { - m_size = 0; - } - } -// qDebug("Font:%d Graphics:%d", m_size, g_size); - return true; - } + if (g_size-- == m_size) + { + if (--m_size < 0) + { + m_size = 0; + } + } +// odebug << "Font:" << m_size << " Graphics:" << g_size << oendl; + return true; + } bool increasesize() - { + { /* - if (++m_size >= m_maxsize) - { - m_size = m_maxsize - 1; - return false; - } - else return true; + if (++m_size >= m_maxsize) + { + m_size = m_maxsize - 1; + return false; + } + else return true; */ - if (g_size++ == m_size) - { - if (++m_size >= m_maxsize) - { - m_size = m_maxsize - 1; - } - } -// qDebug("Font:%d Graphics:%d", m_size, g_size); - return true; - } + if (g_size++ == m_size) + { + if (++m_size >= m_maxsize) + { + m_size = m_maxsize - 1; + } + } +// odebug << "Font:" << m_size << " Graphics:" << g_size << oendl; + return true; + } bool ChangeFont(QString& n) - { - return ChangeFont(n, currentsize()); - } + { + return ChangeFont(n, currentsize()); + } bool ChangeFont(QString& n, int tgt); void setlead(int _lead) - { - m_leading = _lead; - } + { + m_leading = _lead; + } int getlead() - { - return m_leading; - } + { + return m_leading; + } void setextraspace(int _lead) - { - m_extraspace = _lead; - } + { + m_extraspace = _lead; + } int getextraspace() - { - return m_extraspace; - } + { + return m_extraspace; + } }; |