Index: libs/libmythtv/osd.h
===================================================================
--- libs/libmythtv/osd.h	(revision 15506)
+++ libs/libmythtv/osd.h	(working copy)
@@ -81,6 +81,9 @@
                      int length);
     void SetChannumText(const QString &text, int length);
 
+    void SetFontFunction(const QString &container, const QString &funcgroup,
+                         const QString &funcname);
+
     // CC-608 and DVB text captions (not DVB/DVD subtitles).
     void AddCCText(const QString &text, int x, int y, int color, 
                    bool teletextmode = false);
Index: libs/libmythtv/osd.cpp
===================================================================
--- libs/libmythtv/osd.cpp	(revision 15506)
+++ libs/libmythtv/osd.cpp	(working copy)
@@ -872,6 +872,8 @@
 {
     QRect area = QRect(0, 0, 0, 0);
     QString font = "", altfont = "";
+    QStringList fcnGroups;
+    QMap<QString, QString> fcnFontsNeeded;
     QString statictext = "";
     QString defaulttext = "";
     bool multiline = false;
@@ -906,6 +908,37 @@
             {
                 altfont = getFirstText(info);
             }
+            else if (info.tagName() == "fcnfont")
+            {
+                QString fontname = "";
+                QString fontgrp = "";
+                QString fontfcn = "";
+
+                fontname = info.attribute("name", "");
+                fontgrp = info.attribute("group", "");
+                fontfcn = info.attribute("function", "");
+
+                if (fontname.isNull() || fontname.isEmpty())
+                {
+                    cerr << "FcnFont needs a name\n";
+                    return;
+                }
+
+                if (fontgrp.isNull() || fontgrp.isEmpty())
+                {
+                    cerr << "FcnFont needs a group\n";
+                    return;
+                }
+
+                if (fontfcn.isNull() || fontfcn.isEmpty())
+                {
+                    cerr << "FcnFont needs a function\n";
+                    return;
+                }
+                if (fcnGroups.findIndex(fontgrp) == -1)
+                    fcnGroups.push_back(fontgrp);
+                fcnFontsNeeded[fontgrp + "+" + fontfcn] = fontname;
+            }
             else if (info.tagName() == "multiline")
             {
                 if (getFirstText(info).lower() == "yes")
@@ -972,6 +1005,17 @@
             text->SetAltFont(ttffont);
     }
 
+    QMap<QString, TTFFont*> fcnFonts;
+    QMap<QString,QString>::Iterator it;
+    for (it = fcnFontsNeeded.begin(); it != fcnFontsNeeded.end(); ++it)
+    {
+        TTFFont *tmpfont = GetFont(it.data());
+        if (tmpfont)
+            fcnFonts[it.key()] = tmpfont;
+    }
+    if (fcnFonts.size() > 0)
+        text->InitFontFunctions(fcnGroups, fcnFonts);
+
     if (statictext != "")
         text->SetText(statictext);
     if (defaulttext != "")
@@ -1736,6 +1780,16 @@
     osdlock.unlock();
 }
 
+void OSD::SetFontFunction(const QString &container, const QString &funcgroup,
+                     const QString &funcname)
+{
+    osdlock.lock();
+    OSDSet *osdset = GetSet(container);
+    if (osdset)
+        osdset->SetFontFunction(funcgroup, funcname);
+    osdlock.unlock();
+}
+
 void OSD::SetUpOSDClosedHandler(TV *tv)
 {
     OSDSet *container = GetSet("status");
Index: libs/libmythtv/osdtypes.h
===================================================================
--- libs/libmythtv/osdtypes.h	(revision 15506)
+++ libs/libmythtv/osdtypes.h	(working copy)
@@ -103,6 +103,7 @@
     void SetShowWith(const QString &re) { m_showwith = re; };
     bool SetSelected(int index);
     void SetText(const InfoMap &infoMap);
+    void SetFontFunction(const QString &group, const QString &function);
     
   signals:
     void OSDClosed(int);
@@ -203,6 +204,10 @@
     void SetAltFont(TTFFont *font);
     void SetUseAlt(bool usealt) { m_usingalt = usealt; }
 
+    void InitFontFunctions(QStringList groups, QMap<QString, TTFFont*> fonts) {
+                          m_fcngroups = groups; m_fcnfonts = fonts; }
+    void SetFontFunction(const QString &group, const QString &function);
+
     void SetText(const QString &text);
     QString GetText(void) const;
 
@@ -245,6 +250,7 @@
   protected:
     ~OSDTypeText();
 
+    TTFFont* GetCurrentFont();
     void DrawString(OSDSurface *surface, QRect rect, const QString &text,
                     int fade, int maxfade, int xoff, int yoff,
                     bool double_size=false);
@@ -261,6 +267,10 @@
     TTFFont *m_font;
     TTFFont *m_altfont;
 
+    QStringList             m_fcngroups;
+    QMap<QString, TTFFont*> m_fcnfonts;
+    QString                 m_fontfunction;
+
     bool m_centered;
     bool m_right;
 
Index: libs/libmythtv/osdtypes.cpp
===================================================================
--- libs/libmythtv/osdtypes.cpp	(revision 15506)
+++ libs/libmythtv/osdtypes.cpp	(working copy)
@@ -307,6 +307,18 @@
     m_needsupdate = true;
 }
 
+void OSDSet::SetFontFunction(const QString &group, const QString &function)
+{
+    vector<OSDType *>::iterator it = allTypes->begin();
+    for (; it != allTypes->end(); it++)
+    {
+        OSDTypeText *item = dynamic_cast<OSDTypeText*>(*it);
+        if (item)
+            item->SetFontFunction(group, function);
+    }
+    m_needsupdate = true;
+}
+
 void OSDSet::GetText(QMap<QString, QString> &infoMap) const
 {
     vector<OSDType*>::const_iterator it = allTypes->begin();
@@ -755,6 +767,15 @@
     m_altfont = font;
 }
 
+void OSDTypeText::SetFontFunction(const QString &group, const QString &function)
+{
+    if (m_fcngroups.findIndex(group) == -1)
+        return;
+
+    QString key = group + "+" + function;
+    m_fontfunction = (m_fcnfonts.contains(key)) ? key : "";
+}
+
 QString OSDTypeText::BasicConvertFromRtoL(const QString &text)
 {
     QStringList rtl_string_composer;
@@ -908,6 +929,18 @@
     m_displaysize = m_screensize = bias(m_unbiasedsize, wmult, hmult);
 }
 
+TTFFont* OSDTypeText::GetCurrentFont()
+{
+    if (m_fontfunction != "")
+    {
+        TTFFont *tmpfont = m_fcnfonts[m_fontfunction];
+        if (tmpfont)
+            return tmpfont;
+    };
+
+    return m_font;
+}
+
 void OSDTypeText::Draw(OSDSurface *surface, int fade, int maxfade, int xoff, 
                        int yoff)
 {
@@ -929,12 +962,13 @@
     if (m_scroller)
         m_parent->SetDrawEveryFrame(true);
 
-    m_font->CalcWidth(m_message, &textlength);
-
     int maxlength = m_displaysize.width();
 
     if (m_multiline)
     {
+        TTFFont *tmpfont = GetCurrentFont();
+        tmpfont->CalcWidth(m_message, &textlength);
+    
         QString tmp_msg = QDeepCopy<QString>(m_message);
         regexp_lock.lock();
         tmp_msg.replace(br, "\n");
@@ -966,12 +1000,12 @@
             if (!length && word == "\n")
                 continue;
 
-            m_font->CalcWidth(word, &textlength);
-            if ((textlength + m_font->SpaceWidth() + length > maxlength) ||
+            tmpfont->CalcWidth(word, &textlength);
+            if ((textlength + tmpfont->SpaceWidth() + length > maxlength) ||
                 (word == "\n"))
             {
                 QRect drawrect = m_displaysize;
-                drawrect.setTop((int)(m_displaysize.top() + m_font->Size() * 
+                drawrect.setTop((int)(m_displaysize.top() + tmpfont->Size() * 
                                       (lines) * m_linespacing));
                 DrawString(surface, drawrect, line, fade, maxfade, xoff, yoff);
                 length = 0;
@@ -994,28 +1028,30 @@
             else
             {
                 line += " " + word;
-                length += textlength + m_font->SpaceWidth();
+                length += textlength + tmpfont->SpaceWidth();
             }
         }
 
         QRect drawrect = m_displaysize;
-        drawrect.setTop((int)(m_displaysize.top() + m_font->Size() * (lines) *
+        drawrect.setTop((int)(m_displaysize.top() + tmpfont->Size() * (lines) *
                               m_linespacing));
         DrawString(surface, drawrect, line, fade, maxfade, xoff, yoff);
     }           
     else if (m_scroller)
     {
+        TTFFont *tmpfont = GetCurrentFont();
+
         if (!m_scrollinit)
         {
             m_displaysize = m_screensize;
             if (m_scrollx < 0)
             {
-                int numspaces = m_displaysize.width() / m_font->SpaceWidth();
+                int numspaces = m_displaysize.width() / tmpfont->SpaceWidth();
                 for (int i = 0; i < numspaces; i++)
                     m_message.prepend(" ");
 
                 int messagewidth = 0;
-                m_font->CalcWidth(m_message, &messagewidth);
+                tmpfont->CalcWidth(m_message, &messagewidth);
                 m_scrollstartx = 0;
                 m_scrollendx = 0 - (messagewidth);
                 m_scrollposx = m_scrollstartx;
@@ -1024,7 +1060,7 @@
             else if (m_scrollx > 0)
             {
                 int messagewidth = 0;
-                m_font->CalcWidth(m_message, &messagewidth);
+                tmpfont->CalcWidth(m_message, &messagewidth);
                 m_scrollstartx = 0 - (messagewidth);
                 m_scrollendx = m_displaysize.width();
                 m_scrollposx = m_scrollstartx;
@@ -1183,10 +1219,14 @@
 {
     QMutexLocker locker(&m_lock);
 
+    TTFFont *font = GetCurrentFont();
+    if ((m_usingalt || m_selected) && m_altfont)
+        font = m_altfont;
+
     if (m_centered || m_right)
     {
         int textlength = 0;
-        m_font->CalcWidth(text, &textlength);
+        font->CalcWidth(text, &textlength);
 
         int xoffset = rect.width() - textlength;
         if (m_centered)
@@ -1204,9 +1244,6 @@
     if (maxfade > 0 && fade >= 0)
         alphamod = (int)((((float)(fade) / maxfade) * 256.0) + 0.5);
 
-    TTFFont *font = m_font;
-    if ((m_usingalt || m_selected) && m_altfont)
-        font = m_altfont;
 
     font->DrawString(surface, rect.left(), rect.top(), text,
                      rect.right(), rect.bottom(), alphamod, doubl);
@@ -1216,9 +1253,9 @@
     {
         xoff = 0;
         if (m_cursorpos > 0)
-            m_font->CalcWidth(text.left(m_cursorpos), &xoff);
+            font->CalcWidth(text.left(m_cursorpos), &xoff);
 
-        QRect crect(rect.left(), rect.top(), 2, (m_font->Size() * 3) / 2);
+        QRect crect(rect.left(), rect.top(), 2, (font->Size() * 3) / 2);
         if (crect.right() < surface->width && crect.right() < rect.right())
         {
             OSDTypeBox box("cursor", crect, 1.0f, 1.0f);

