Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #3166 from koying/fixfontpath

FIX: Consistenly look for fonts in special//home, then special://xbmc
  • Loading branch information...
commit c8238f514015b276cfc4520e24a395caf5a81171 2 parents 6e4f061 + dcc0b4c
Chris Browet koying authored
7 xbmc/cores/dvdplayer/DVDSubtitles/DVDSubtitlesLibass.cpp
View
@@ -20,9 +20,11 @@
#include "DVDSubtitlesLibass.h"
#include "DVDClock.h"
+#include "filesystem/File.h"
#include "filesystem/SpecialProtocol.h"
#include "settings/Settings.h"
#include "utils/log.h"
+#include "utils/URIUtils.h"
#include "threads/SingleLock.h"
#include "threads/Atomics.h"
#include "guilib/GraphicContext.h"
@@ -77,8 +79,9 @@ CDVDSubtitlesLibass::CDVDSubtitlesLibass()
return;
//Setting default font to the Arial in \media\fonts (used if FontConfig fails)
- strPath = "special://xbmc/media/Fonts/";
- strPath += CSettings::Get().GetString("subtitles.font");
+ strPath = URIUtils::AddFileToFolder("special://home/media/Fonts/", CSettings::Get().GetString("subtitles.font"));
+ if (!XFILE::CFile::Exists(strPath))
+ strPath = URIUtils::AddFileToFolder("special://xbmc/media/Fonts/", CSettings::Get().GetString("subtitles.font"));
int fc = !CSettings::Get().GetBool("subtitles.overrideassfonts");
m_dll.ass_set_margins(m_renderer, 0, 0, 0, 0);
4 xbmc/music/karaoke/karaokelyricstext.cpp
View
@@ -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 = URIUtils::AddFileToFolder("special://home/media/Fonts/", CSettings::Get().GetString("karaoke.font"));
+ if (!XFILE::CFile::Exists(fontPath))
+ fontPath = URIUtils::AddFileToFolder("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,
7 xbmc/video/windows/GUIWindowFullScreen.cpp
View
@@ -50,12 +50,14 @@
#include "threads/SingleLock.h"
#include "utils/log.h"
#include "utils/TimeUtils.h"
+#include "utils/URIUtils.h"
#include "XBDateTime.h"
#include "input/ButtonTranslator.h"
#include "pvr/PVRManager.h"
#include "pvr/channels/PVRChannelGroupsContainer.h"
#include "windowing/WindowingFactory.h"
#include "cores/IPlayer.h"
+#include "filesystem/File.h"
#include <stdio.h>
#include <algorithm>
@@ -401,8 +403,9 @@ bool CGUIWindowFullScreen::OnMessage(CGUIMessage& message)
{
CSingleLock lock (m_fontLock);
- CStdString fontPath = "special://xbmc/media/Fonts/";
- fontPath += CSettings::Get().GetString("subtitles.font");
+ CStdString fontPath = URIUtils::AddFileToFolder("special://home/media/Fonts/", CSettings::Get().GetString("subtitles.font"));
+ if (!XFILE::CFile::Exists(fontPath))
+ fontPath = URIUtils::AddFileToFolder("special://xbmc/media/Fonts/", 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);
Please sign in to comment.
Something went wrong with that request. Please try again.