From 8b649a7fa73b9449597b1cf3513e75c8f4733002 Mon Sep 17 00:00:00 2001 From: anbr Date: Thu, 29 Apr 2010 20:44:38 +0200 Subject: Allow setup font size Show current time, on dual line mode --- vfd.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'vfd.c') diff --git a/vfd.c b/vfd.c index 1670eab..2ea935c 100644 --- a/vfd.c +++ b/vfd.c @@ -260,7 +260,10 @@ cVFD::~cVFD() { */ bool cVFD::open() { - if(!SetFont(theSetup.m_szFont,theSetup.m_bTwoLineMode)) { + if(!SetFont(theSetup.m_szFont, + theSetup.m_bTwoLineMode, + theSetup.m_nBigFontHeight, + theSetup.m_nSmallFontHeight)) { return false; } if(!cVFDQueue::open()) { @@ -445,18 +448,17 @@ void cVFD::Brightness(int nBrightness) this->QueueData((byte) (nBrightness)); } -bool cVFD::SetFont(const char *szFont, int bTwoLineMode) { +bool cVFD::SetFont(const char *szFont, int bTwoLineMode, int nBigFontHeight, int nSmallFontHeight) { cVFDFont* tmpFont = NULL; cString sFileName = cFont::GetFontFileName(szFont); if(!isempty(sFileName)) { - if (bTwoLineMode) - { - tmpFont = new cVFDFont(sFileName,6,8); + if (bTwoLineMode) { + tmpFont = new cVFDFont(sFileName,nSmallFontHeight); } else { - tmpFont = new cVFDFont(sFileName,12,11); + tmpFont = new cVFDFont(sFileName,nBigFontHeight); } } else { esyslog("targaVFD: unable to find font '%s'",szFont); -- cgit v1.2.3