summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-reader/FontControl.h
Side-by-side diff
Diffstat (limited to 'noncore/apps/opie-reader/FontControl.h') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/opie-reader/FontControl.h43
1 files changed, 31 insertions, 12 deletions
diff --git a/noncore/apps/opie-reader/FontControl.h b/noncore/apps/opie-reader/FontControl.h
index e56b619..90d39b2 100644
--- a/noncore/apps/opie-reader/FontControl.h
+++ b/noncore/apps/opie-reader/FontControl.h
@@ -3,3 +3,2 @@
-#include <qfontdatabase.h>
#include <qfontmetrics.h>
@@ -17,3 +16,12 @@ class FontControl
unsigned char m_basesize;
+ bool m_fixgraphics;
public:
+ void FixGraphics(bool _b)
+ {
+ m_fixgraphics = _b;
+ }
+ bool FixGraphics()
+ {
+ return m_fixgraphics;
+ }
void setBaseSize(unsigned char _s) { m_basesize = _s; }
@@ -23,3 +31,3 @@ class FontControl
:
- m_fontsizes(NULL), m_hasCourier(false), m_leading(0), m_extraspace(0)
+ m_fontsizes(NULL), m_hasCourier(false), m_leading(0), m_extraspace(0), m_fixgraphics(true)
{
@@ -39,6 +47,10 @@ class FontControl
QString name() { return m_fontname; }
- int currentsize() { return m_fontsizes[m_size]; }
+ int currentsize() { return (m_fontsizes == NULL) ? 0 : m_fontsizes[m_size]; }
int getsize(const CStyle& size)
{
- int tgt = m_size+size.getFontSize();
+ return getsize(size.getFontSize());
+ }
+ int getsize(int _offset)
+ {
+ int tgt = m_size+_offset;
if (tgt < 0)
@@ -91,3 +103,4 @@ class FontControl
{
-/*
+ if (m_fixgraphics)
+ {
if (--m_size < 0)
@@ -97,4 +110,6 @@ class FontControl
}
- else return true;
-*/
+ g_size = m_size;
+ }
+ else
+ {
if (g_size-- == m_size)
@@ -106,3 +121,4 @@ class FontControl
}
-// odebug << "Font:" << m_size << " Graphics:" << g_size << oendl;
+ }
+// qDebug("Font:%d Graphics:%d", m_size, g_size);
return true;
@@ -111,3 +127,4 @@ class FontControl
{
-/*
+ if (m_fixgraphics)
+ {
if (++m_size >= m_maxsize)
@@ -117,4 +134,6 @@ class FontControl
}
- else return true;
-*/
+ g_size = m_size;
+ }
+ else
+ {
if (g_size++ == m_size)
@@ -126,3 +145,3 @@ class FontControl
}
-// odebug << "Font:" << m_size << " Graphics:" << g_size << oendl;
+ }
return true;