Permalink
Browse files

Revert "Subtitles: Remove the OSDSubFont setting."

This reverts commit 25fe663.

The OSDSubFont setting will be replaced with a new setting called
DefaultSubtitleFont with a default value of FreeMono.
  • Loading branch information...
1 parent 4a2420e commit 6202c0d156c3e09eeeb050902468390495ae291d @stichnot stichnot committed Feb 29, 2012
@@ -99,7 +99,7 @@ bool SubtitleScreen::Create(void)
m_useBackground = (bool)gCoreContext->GetNumSetting("CCBackground", 0);
m_textFontZoom = gCoreContext->GetNumSetting("OSDCC708TextZoom", 100);
- QString defaultFont = "FreeMono";
+ QString defaultFont = gCoreContext->GetSetting("OSDSubFont", "FreeSans");
m_fontNames.append(defaultFont); // default
m_fontNames.append("FreeMono"); // mono serif
m_fontNames.append("DejaVu Serif"); // prop serif
@@ -674,7 +674,7 @@ void TeletextScreen::DrawStatus(void)
bool TeletextScreen::InitialiseFont()
{
static bool initialised = false;
- QString font = "FreeMono";
+ QString font = gCoreContext->GetSetting("OSDSubFont", "FreeSans");
if (initialised)
{
if (gTTFont->face().family() == font)
@@ -1368,6 +1368,23 @@ static HostSpinBox *OSDCC708TextZoomPercentage(void)
return gs;
}
+static HostComboBox *SubtitleFont()
+{
+ HostComboBox *hcb = new HostComboBox("OSDSubFont");
+ QFontDatabase db;
+ QStringList fonts = db.families();
+ QStringList hide = db.families(QFontDatabase::Symbol);
+
+ hcb->setLabel(QObject::tr("Subtitle Font"));
+ hcb->setHelpText(QObject::tr("The font to use for text based subtitles."));
+ foreach (QString font, fonts)
+ {
+ if (!hide.contains(font))
+ hcb->addSelection(font, font, font.toLower() == "freesans");
+ }
+ return hcb;
+}
+
static HostComboBox *SubtitleCodec()
{
HostComboBox *gc = new HostComboBox("SubtitleCodec");
@@ -3443,6 +3460,7 @@ OSDSettings::OSDSettings()
osd->addChild(CCBackground());
osd->addChild(DefaultCCMode());
osd->addChild(PreferCC708());
+ osd->addChild(SubtitleFont());
osd->addChild(OSDCC708TextZoomPercentage());
osd->addChild(SubtitleCodec());
addChild(osd);

0 comments on commit 6202c0d

Please sign in to comment.