author | pohly <pohly> | 2005-05-05 14:39:33 (UTC) |
---|---|---|
committer | pohly <pohly> | 2005-05-05 14:39:33 (UTC) |
commit | 39fbfd5eb7e45d73d38e8a2ce9437a3d7e1b8e91 (patch) (side-by-side diff) | |
tree | 96e66fdc18dca4d4ab8611133e072f57dea224b9 /noncore/apps/opie-reader/FontControl.h | |
parent | 279fc4fd1986074acbadd3a8e86fcf3968a8dd5c (diff) | |
download | opie-39fbfd5eb7e45d73d38e8a2ce9437a3d7e1b8e91.zip opie-39fbfd5eb7e45d73d38e8a2ce9437a3d7e1b8e91.tar.gz opie-39fbfd5eb7e45d73d38e8a2ce9437a3d7e1b8e91.tar.bz2 |
new opie-reader sources with support for ArriereGo, Reb input and flite output plugins
Diffstat (limited to 'noncore/apps/opie-reader/FontControl.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-reader/FontControl.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/apps/opie-reader/FontControl.h b/noncore/apps/opie-reader/FontControl.h index 90d39b2..563e1a8 100644 --- a/noncore/apps/opie-reader/FontControl.h +++ b/noncore/apps/opie-reader/FontControl.h @@ -40,49 +40,49 @@ class FontControl void hasCourier(bool _b, const QString& _nm) { m_hasCourier = _b; m_fixedfontname = _nm; } QString& fixedfontname() { return m_fixedfontname; } bool hasCourier() { return m_hasCourier; } QString name() { return m_fontname; } int currentsize() { return (m_fontsizes == NULL) ? 0 : m_fontsizes[m_size]; } int getsize(const CStyle& size) { return getsize(size.getFontSize()); } int getsize(int _offset) { int tgt = m_size+_offset; if (tgt < 0) { tgt = 0; } if (tgt >= m_maxsize) { tgt = m_maxsize - 1; } - return m_fontsizes[tgt]; + return tgt >= 0 ? m_fontsizes[tgt] : 12; } int ascent() { QFont f(name(), currentsize()); QFontMetrics fm(f); return fm.ascent(); } int ascent(const CStyle& ch) { QFont f(name(), getsize(ch)); QFontMetrics fm(f); return fm.ascent(); } int descent() { QFont f(name(), currentsize()); QFontMetrics fm(f); return fm.descent(); } int descent(const CStyle& ch) { QFont f(name(), getsize(ch)); QFontMetrics fm(f); return fm.descent(); |