Skip to content

Commit

Permalink
StFTFontRegistry - look for the fonts within APP_PREFIX/share/fonts a…
Browse files Browse the repository at this point in the history
…nd $StShare/fonts
  • Loading branch information
gkv311 committed Sep 28, 2024
1 parent b7b47c3 commit c6aac6d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions StShared/StFTFontRegistry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ StFTFontRegistry::StFTFontRegistry() {
myExtensions.add("ttc");
myExtensions.add("otf");

const StString aCustFontDir = StProcess::getStShareFolder() + "fonts" + SYS_FS_SPLITTER;
if(StFolder::isFolder(aCustFontDir)) {
myFolders.add(aCustFontDir);
}
#ifdef _WIN32
myFolders.add(StProcess::getWindowsFolder() + "fonts");

Expand Down Expand Up @@ -133,6 +137,12 @@ StFTFontRegistry::StFTFontRegistry() {
}
#endif
if(myFolders.isEmpty()) {
#ifdef APP_PREFIX
if(!StString(stCString(APP_PREFIX)).isEquals(stCString("/usr"))) {
myFolders.add(stCString(APP_PREFIX"/share/fonts"));
myFolders.add(stCString(APP_PREFIX"/local/share/fonts"));
}
#endif
myFolders.add(stCString("/usr/share/fonts"));
myFolders.add(stCString("/usr/local/share/fonts"));
}
Expand Down

0 comments on commit c6aac6d

Please sign in to comment.