From 3c26d247ecdba709cfa3cf22a53b4626ee0b88e0 Mon Sep 17 00:00:00 2001 From: anbr Date: Tue, 29 Sep 2009 20:24:09 +0200 Subject: Add mode to show information on two lines provided by Sven (cokker) (Feature #161) --- imon.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'imon.c') diff --git a/imon.c b/imon.c index 958d809..b455eba 100644 --- a/imon.c +++ b/imon.c @@ -132,7 +132,7 @@ ciMonLCD::~ciMonLCD() { */ int ciMonLCD::open(const char* szDevice, eProtocol pro) { - if(!SetFont(theSetup.m_szFont)) { + if(!SetFont(theSetup.m_szFont,theSetup.m_bTwoLineMode)) { return -1; } @@ -636,13 +636,19 @@ int ciMonLCD::lengthToPixels(int length) return (pixLen[32 + length] ^ 0xffffffff); } -bool ciMonLCD::SetFont(const char *szFont) { +bool ciMonLCD::SetFont(const char *szFont, int bTwoLineMode) { ciMonFont* tmpFont = NULL; cString sFileName = cFont::GetFontFileName(szFont); - if(!isempty(sFileName)) { - tmpFont = new ciMonFont(sFileName,12,11); + if(!isempty(sFileName)) + { + if (bTwoLineMode) + { + tmpFont = new ciMonFont(sFileName,6,8); + } else { + tmpFont = new ciMonFont(sFileName,12,11); + } } else { esyslog("iMonLCD: unable to find file for font '%s'",szFont); } -- cgit v1.2.3