Skip to content
This repository
Browse code

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 authored September 19, 2013
7  xbmc/cores/dvdplayer/DVDSubtitles/DVDSubtitlesLibass.cpp
@@ -20,9 +20,11 @@
20 20
 
21 21
 #include "DVDSubtitlesLibass.h"
22 22
 #include "DVDClock.h"
  23
+#include "filesystem/File.h"
23 24
 #include "filesystem/SpecialProtocol.h"
24 25
 #include "settings/Settings.h"
25 26
 #include "utils/log.h"
  27
+#include "utils/URIUtils.h"
26 28
 #include "threads/SingleLock.h"
27 29
 #include "threads/Atomics.h"
28 30
 #include "guilib/GraphicContext.h"
@@ -77,8 +79,9 @@ CDVDSubtitlesLibass::CDVDSubtitlesLibass()
77 79
     return;
78 80
 
79 81
   //Setting default font to the Arial in \media\fonts (used if FontConfig fails)
80  
-  strPath = "special://xbmc/media/Fonts/";
81  
-  strPath += CSettings::Get().GetString("subtitles.font");
  82
+  strPath = URIUtils::AddFileToFolder("special://home/media/Fonts/", CSettings::Get().GetString("subtitles.font"));
  83
+  if (!XFILE::CFile::Exists(strPath))
  84
+    strPath = URIUtils::AddFileToFolder("special://xbmc/media/Fonts/", CSettings::Get().GetString("subtitles.font"));
82 85
   int fc = !CSettings::Get().GetBool("subtitles.overrideassfonts");
83 86
 
84 87
   m_dll.ass_set_margins(m_renderer, 0, 0, 0, 0);
4  xbmc/music/karaoke/karaokelyricstext.cpp
@@ -139,7 +139,9 @@ bool CKaraokeLyricsText::InitGraphics()
139 139
   if ( m_lyrics.empty() )
140 140
     return false;
141 141
 
142  
-  CStdString fontPath = "special://xbmc/media/Fonts/" + CSettings::Get().GetString("karaoke.font");
  142
+  CStdString fontPath = URIUtils::AddFileToFolder("special://home/media/Fonts/", CSettings::Get().GetString("karaoke.font"));
  143
+  if (!XFILE::CFile::Exists(fontPath))
  144
+      fontPath = URIUtils::AddFileToFolder("special://xbmc/media/Fonts/", CSettings::Get().GetString("karaoke.font"));
143 145
   m_karaokeFont = g_fontManager.LoadTTF("__karaoke__", fontPath,
144 146
                   m_colorLyrics, 0, CSettings::Get().GetInt("karaoke.fontheight"), FONT_STYLE_BOLD );
145 147
   CGUIFont *karaokeBorder = g_fontManager.LoadTTF("__karaokeborder__", fontPath,
7  xbmc/video/windows/GUIWindowFullScreen.cpp
@@ -50,12 +50,14 @@
50 50
 #include "threads/SingleLock.h"
51 51
 #include "utils/log.h"
52 52
 #include "utils/TimeUtils.h"
  53
+#include "utils/URIUtils.h"
53 54
 #include "XBDateTime.h"
54 55
 #include "input/ButtonTranslator.h"
55 56
 #include "pvr/PVRManager.h"
56 57
 #include "pvr/channels/PVRChannelGroupsContainer.h"
57 58
 #include "windowing/WindowingFactory.h"
58 59
 #include "cores/IPlayer.h"
  60
+#include "filesystem/File.h"
59 61
 
60 62
 #include <stdio.h>
61 63
 #include <algorithm>
@@ -401,8 +403,9 @@ bool CGUIWindowFullScreen::OnMessage(CGUIMessage& message)
401 403
       {
402 404
         CSingleLock lock (m_fontLock);
403 405
 
404  
-        CStdString fontPath = "special://xbmc/media/Fonts/";
405  
-        fontPath += CSettings::Get().GetString("subtitles.font");
  406
+        CStdString fontPath = URIUtils::AddFileToFolder("special://home/media/Fonts/", CSettings::Get().GetString("subtitles.font"));
  407
+        if (!XFILE::CFile::Exists(fontPath))
  408
+          fontPath = URIUtils::AddFileToFolder("special://xbmc/media/Fonts/", CSettings::Get().GetString("subtitles.font"));
406 409
 
407 410
         // We scale based on PAL4x3 - this at least ensures all sizing is constant across resolutions.
408 411
         RESOLUTION_INFO pal(720, 576, 0);

0 notes on commit c8238f5

Please sign in to comment.
Something went wrong with that request. Please try again.