xbmc: add xbmc PR3166

see https://github.com/xbmc/xbmc/pull/3166
This commit is contained in:
Stefan Saraev 2013-08-31 22:27:44 +03:00
parent 47ffb91b52
commit 2145dafca0

View File

@ -0,0 +1,69 @@
diff --git a/xbmc/cores/dvdplayer/DVDSubtitles/DVDSubtitlesLibass.cpp b/xbmc/cores/dvdplayer/DVDSubtitles/DVDSubtitlesLibass.cpp
index da7a06c..86a328e 100644
--- a/xbmc/cores/dvdplayer/DVDSubtitles/DVDSubtitlesLibass.cpp
+++ b/xbmc/cores/dvdplayer/DVDSubtitles/DVDSubtitlesLibass.cpp
@@ -20,6 +20,7 @@
#include "DVDSubtitlesLibass.h"
#include "DVDClock.h"
+#include "filesystem/File.h"
#include "filesystem/SpecialProtocol.h"
#include "settings/GUISettings.h"
#include "utils/log.h"
@@ -76,8 +77,13 @@ CDVDSubtitlesLibass::CDVDSubtitlesLibass()
return;
//Setting default font to the Arial in \media\fonts (used if FontConfig fails)
- strPath = "special://xbmc/media/Fonts/";
+ strPath = "special://home/media/Fonts/";
strPath += g_guiSettings.GetString("subtitles.font");
+ if (!XFILE::CFile::Exists(strPath))
+ {
+ strPath = "special://xbmc/media/Fonts/";
+ strPath += g_guiSettings.GetString("subtitles.font");
+ }
int fc = !g_guiSettings.GetBool("subtitles.overrideassfonts");
m_dll.ass_set_margins(m_renderer, 0, 0, 0, 0);
diff --git a/xbmc/music/karaoke/karaokelyricstext.cpp b/xbmc/music/karaoke/karaokelyricstext.cpp
index a73881c..fa9c49f 100644
--- a/xbmc/music/karaoke/karaokelyricstext.cpp
+++ b/xbmc/music/karaoke/karaokelyricstext.cpp
@@ -139,7 +139,9 @@ bool CKaraokeLyricsText::InitGraphics()
if ( m_lyrics.empty() )
return false;
- CStdString fontPath = "special://xbmc/media/Fonts/" + g_guiSettings.GetString("karaoke.font");
+ CStdString fontPath = "special://home/media/Fonts/" + g_guiSettings.GetString("karaoke.font");
+ if (!XFILE::CFile::Exists(fontPath))
+ fontPath = "special://xbmc/media/Fonts/" + g_guiSettings.GetString("karaoke.font");;
m_karaokeFont = g_fontManager.LoadTTF("__karaoke__", fontPath,
m_colorLyrics, 0, g_guiSettings.GetInt("karaoke.fontheight"), FONT_STYLE_BOLD );
CGUIFont *karaokeBorder = g_fontManager.LoadTTF("__karaokeborder__", fontPath,
diff --git a/xbmc/video/windows/GUIWindowFullScreen.cpp b/xbmc/video/windows/GUIWindowFullScreen.cpp
index 519bcfb..0583e6a 100644
--- a/xbmc/video/windows/GUIWindowFullScreen.cpp
+++ b/xbmc/video/windows/GUIWindowFullScreen.cpp
@@ -56,6 +56,7 @@
#include "pvr/PVRManager.h"
#include "pvr/channels/PVRChannelGroupsContainer.h"
#include "windowing/WindowingFactory.h"
+#include "filesystem/File.h"
#include <stdio.h>
#include <algorithm>
@@ -707,8 +708,13 @@ bool CGUIWindowFullScreen::OnMessage(CGUIMessage& message)
{
CSingleLock lock (m_fontLock);
- CStdString fontPath = "special://xbmc/media/Fonts/";
+ CStdString fontPath = "special://home/media/Fonts/";
fontPath += g_guiSettings.GetString("subtitles.font");
+ if (!XFILE::CFile::Exists(fontPath))
+ {
+ fontPath = "special://xbmc/media/Fonts/";
+ fontPath += g_guiSettings.GetString("subtitles.font");
+ }
// We scale based on PAL4x3 - this at least ensures all sizing is constant across resolutions.
RESOLUTION_INFO pal(720, 576, 0);