Diffstat (limited to 'noncore/apps/opie-reader/FontControl.h') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/apps/opie-reader/FontControl.h | 43 |
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 @@ | |||
3 | 3 | ||
4 | #include <qfontdatabase.h> | ||
5 | #include <qfontmetrics.h> | 4 | #include <qfontmetrics.h> |
@@ -17,3 +16,12 @@ class FontControl | |||
17 | unsigned char m_basesize; | 16 | unsigned char m_basesize; |
17 | bool m_fixgraphics; | ||
18 | public: | 18 | public: |
19 | void FixGraphics(bool _b) | ||
20 | { | ||
21 | m_fixgraphics = _b; | ||
22 | } | ||
23 | bool FixGraphics() | ||
24 | { | ||
25 | return m_fixgraphics; | ||
26 | } | ||
19 | void setBaseSize(unsigned char _s) { m_basesize = _s; } | 27 | void setBaseSize(unsigned char _s) { m_basesize = _s; } |
@@ -23,3 +31,3 @@ class FontControl | |||
23 | : | 31 | : |
24 | m_fontsizes(NULL), m_hasCourier(false), m_leading(0), m_extraspace(0) | 32 | m_fontsizes(NULL), m_hasCourier(false), m_leading(0), m_extraspace(0), m_fixgraphics(true) |
25 | { | 33 | { |
@@ -39,6 +47,10 @@ class FontControl | |||
39 | QString name() { return m_fontname; } | 47 | QString name() { return m_fontname; } |
40 | int currentsize() { return m_fontsizes[m_size]; } | 48 | int currentsize() { return (m_fontsizes == NULL) ? 0 : m_fontsizes[m_size]; } |
41 | int getsize(const CStyle& size) | 49 | int getsize(const CStyle& size) |
42 | { | 50 | { |
43 | int tgt = m_size+size.getFontSize(); | 51 | return getsize(size.getFontSize()); |
52 | } | ||
53 | int getsize(int _offset) | ||
54 | { | ||
55 | int tgt = m_size+_offset; | ||
44 | if (tgt < 0) | 56 | if (tgt < 0) |
@@ -91,3 +103,4 @@ class FontControl | |||
91 | { | 103 | { |
92 | /* | 104 | if (m_fixgraphics) |
105 | { | ||
93 | if (--m_size < 0) | 106 | if (--m_size < 0) |
@@ -97,4 +110,6 @@ class FontControl | |||
97 | } | 110 | } |
98 | else return true; | 111 | g_size = m_size; |
99 | */ | 112 | } |
113 | else | ||
114 | { | ||
100 | if (g_size-- == m_size) | 115 | if (g_size-- == m_size) |
@@ -106,3 +121,4 @@ class FontControl | |||
106 | } | 121 | } |
107 | // odebug << "Font:" << m_size << " Graphics:" << g_size << oendl; | 122 | } |
123 | // qDebug("Font:%d Graphics:%d", m_size, g_size); | ||
108 | return true; | 124 | return true; |
@@ -111,3 +127,4 @@ class FontControl | |||
111 | { | 127 | { |
112 | /* | 128 | if (m_fixgraphics) |
129 | { | ||
113 | if (++m_size >= m_maxsize) | 130 | if (++m_size >= m_maxsize) |
@@ -117,4 +134,6 @@ class FontControl | |||
117 | } | 134 | } |
118 | else return true; | 135 | g_size = m_size; |
119 | */ | 136 | } |
137 | else | ||
138 | { | ||
120 | if (g_size++ == m_size) | 139 | if (g_size++ == m_size) |
@@ -126,3 +145,3 @@ class FontControl | |||
126 | } | 145 | } |
127 | // odebug << "Font:" << m_size << " Graphics:" << g_size << oendl; | 146 | } |
128 | return true; | 147 | return true; |