xbmc: add PR3166

Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
Stephan Raue 2013-09-04 00:25:03 +02:00
parent 996213b233
commit 7f601cc146

View File

@ -0,0 +1,86 @@
From 1501e49f96f75d12ef8071f30ca3338ea18f4ff4 Mon Sep 17 00:00:00 2001
From: "Chris \"Koying\" Browet" <cbro@semperpax.com>
Date: Sat, 31 Aug 2013 03:04:48 +0200
Subject: [PATCH] FIX: Consistenly look for fonts in special//home, then
special://xbmc
---
xbmc/cores/dvdplayer/DVDSubtitles/DVDSubtitlesLibass.cpp | 10 ++++++++--
xbmc/music/karaoke/karaokelyricstext.cpp | 4 +++-
xbmc/video/windows/GUIWindowFullScreen.cpp | 8 +++++++-
3 files changed, 18 insertions(+), 4 deletions(-)
diff --git a/xbmc/cores/dvdplayer/DVDSubtitles/DVDSubtitlesLibass.cpp b/xbmc/cores/dvdplayer/DVDSubtitles/DVDSubtitlesLibass.cpp
index 2a4efde..5d7b855 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/Settings.h"
#include "utils/log.h"
@@ -75,9 +76,14 @@ static void libass_log(int level, const char *fmt, va_list args, void *data)
if(!m_renderer)
return;
- //Setting default font to the Arial in \media\fonts (used if FontConfig fails)
- strPath = "special://xbmc/media/Fonts/";
+ //Setting default font to the Arial in \media\fonts (used if FontConfig fails)
+ strPath = "special://home/media/Fonts/";
strPath += CSettings::Get().GetString("subtitles.font");
+ if (!XFILE::CFile::Exists(strPath))
+ {
+ strPath = "special://xbmc/media/Fonts/";
+ strPath += CSettings::Get().GetString("subtitles.font");
+ }
int fc = !CSettings::Get().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 f04f4c5..f43a188 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/" + CSettings::Get().GetString("karaoke.font");
+ CStdString fontPath = "special://home/media/Fonts/" + CSettings::Get().GetString("karaoke.font");
+ if (!XFILE::CFile::Exists(fontPath))
+ fontPath = "special://xbmc/media/Fonts/" + CSettings::Get().GetString("karaoke.font");
m_karaokeFont = g_fontManager.LoadTTF("__karaoke__", fontPath,
m_colorLyrics, 0, CSettings::Get().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 9c8526d..bd1e9ed 100644
--- a/xbmc/video/windows/GUIWindowFullScreen.cpp
+++ b/xbmc/video/windows/GUIWindowFullScreen.cpp
@@ -56,6 +56,7 @@
#include "pvr/channels/PVRChannelGroupsContainer.h"
#include "windowing/WindowingFactory.h"
#include "cores/IPlayer.h"
+#include "filesystem/File.h"
#include <stdio.h>
#include <algorithm>
@@ -401,8 +402,13 @@ bool CGUIWindowFullScreen::OnMessage(CGUIMessage& message)
{
CSingleLock lock (m_fontLock);
- CStdString fontPath = "special://xbmc/media/Fonts/";
+ CStdString fontPath = "special://home/media/Fonts/";
fontPath += CSettings::Get().GetString("subtitles.font");
+ if (!XFILE::CFile::Exists(fontPath))
+ {
+ fontPath = "special://xbmc/media/Fonts/";
+ fontPath += CSettings::Get().GetString("subtitles.font");
+ }
// We scale based on PAL4x3 - this at least ensures all sizing is constant across resolutions.
RESOLUTION_INFO pal(720, 576, 0);
--
1.8.4