mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2024-11-26 13:48:38 -05:00
Refactor: put fonts in their own 'fonts' subdir, because they are quite numerous now
This commit is contained in:
parent
4d12b2f392
commit
46bf72aa0f
@ -581,8 +581,8 @@ if(MINGW OR MSVC)
|
|||||||
endif(MINGW OR MSVC)
|
endif(MINGW OR MSVC)
|
||||||
|
|
||||||
IF (NOT BUNDLE_APP)
|
IF (NOT BUNDLE_APP)
|
||||||
configure_files(${PROJECT_SOURCE_DIR}/font ${CMAKE_BINARY_DIR}/${EX_PLATFORM_NAME} "*.fnt")
|
configure_files(${PROJECT_SOURCE_DIR}/font ${CMAKE_BINARY_DIR}/${EX_PLATFORM_NAME}/fonts "*.fnt")
|
||||||
configure_files(${PROJECT_SOURCE_DIR}/font ${CMAKE_BINARY_DIR}/${EX_PLATFORM_NAME} "*.png")
|
configure_files(${PROJECT_SOURCE_DIR}/font ${CMAKE_BINARY_DIR}/${EX_PLATFORM_NAME}/fonts "*.png")
|
||||||
configure_files(${PROJECT_SOURCE_DIR}/icon ${CMAKE_BINARY_DIR}/${EX_PLATFORM_NAME} CubicSDR.ico)
|
configure_files(${PROJECT_SOURCE_DIR}/icon ${CMAKE_BINARY_DIR}/${EX_PLATFORM_NAME} CubicSDR.ico)
|
||||||
IF(MSVC)
|
IF(MSVC)
|
||||||
IF(ENABLE_FFTW3)
|
IF(ENABLE_FFTW3)
|
||||||
|
@ -25,17 +25,17 @@ GLFontStringCache::GLFontStringCache() {
|
|||||||
//using aggregate syntax (Cx11+)
|
//using aggregate syntax (Cx11+)
|
||||||
GLFont GLFont::fonts[GLFont::GLFontSize::GLFONT_SIZE_MAX] = {
|
GLFont GLFont::fonts[GLFont::GLFontSize::GLFONT_SIZE_MAX] = {
|
||||||
|
|
||||||
{ GLFont::GLFontSize::GLFONT_SIZE12, L"vera_sans_mono12.fnt" },
|
{ GLFont::GLFontSize::GLFONT_SIZE12, L"fonts/vera_sans_mono12.fnt" },
|
||||||
{ GLFont::GLFontSize::GLFONT_SIZE16, L"vera_sans_mono16.fnt" },
|
{ GLFont::GLFontSize::GLFONT_SIZE16, L"fonts/vera_sans_mono16.fnt" },
|
||||||
{ GLFont::GLFontSize::GLFONT_SIZE18, L"vera_sans_mono18.fnt" },
|
{ GLFont::GLFontSize::GLFONT_SIZE18, L"fonts/vera_sans_mono18.fnt" },
|
||||||
{ GLFont::GLFontSize::GLFONT_SIZE24, L"vera_sans_mono24.fnt" },
|
{ GLFont::GLFontSize::GLFONT_SIZE24, L"fonts/vera_sans_mono24.fnt" },
|
||||||
{ GLFont::GLFontSize::GLFONT_SIZE27, L"vera_sans_mono27.fnt" },
|
{ GLFont::GLFontSize::GLFONT_SIZE27, L"fonts/vera_sans_mono27.fnt" },
|
||||||
{ GLFont::GLFontSize::GLFONT_SIZE32, L"vera_sans_mono32.fnt" },
|
{ GLFont::GLFontSize::GLFONT_SIZE32, L"fonts/vera_sans_mono32.fnt" },
|
||||||
{ GLFont::GLFontSize::GLFONT_SIZE36, L"vera_sans_mono36.fnt" },
|
{ GLFont::GLFontSize::GLFONT_SIZE36, L"fonts/vera_sans_mono36.fnt" },
|
||||||
{ GLFont::GLFontSize::GLFONT_SIZE48, L"vera_sans_mono48.fnt" },
|
{ GLFont::GLFontSize::GLFONT_SIZE48, L"fonts/vera_sans_mono48.fnt" },
|
||||||
{ GLFont::GLFontSize::GLFONT_SIZE64, L"vera_sans_mono64.fnt" },
|
{ GLFont::GLFontSize::GLFONT_SIZE64, L"fonts/vera_sans_mono64.fnt" },
|
||||||
{ GLFont::GLFontSize::GLFONT_SIZE72, L"vera_sans_mono72.fnt" },
|
{ GLFont::GLFontSize::GLFONT_SIZE72, L"fonts/vera_sans_mono72.fnt" },
|
||||||
{ GLFont::GLFontSize::GLFONT_SIZE96, L"vera_sans_mono96.fnt" },
|
{ GLFont::GLFontSize::GLFONT_SIZE96, L"fonts/vera_sans_mono96.fnt" },
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -154,7 +154,7 @@ GLFont::GLFont(GLFontSize size, std::wstring fontFileName):
|
|||||||
lineHeight(0), base(0), imageWidth(0), imageHeight(0), loaded(false), texId(0), gcCounter(0) {
|
lineHeight(0), base(0), imageWidth(0), imageHeight(0), loaded(false), texId(0), gcCounter(0) {
|
||||||
|
|
||||||
fontSizeClass = size;
|
fontSizeClass = size;
|
||||||
//relative path to RES_FOLDER
|
|
||||||
fontFileSource = fontFileName;
|
fontFileSource = fontFileName;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -212,6 +212,7 @@ void GLFont::loadFontOnce() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//relative path with filename where the font is
|
||||||
std::wstring fontFile = fontFileSource;
|
std::wstring fontFile = fontFileSource;
|
||||||
|
|
||||||
wxString resourceFolder = RES_FOLDER;
|
wxString resourceFolder = RES_FOLDER;
|
||||||
@ -220,12 +221,19 @@ void GLFont::loadFontOnce() {
|
|||||||
resourceFolder = getExePath() + L"/" + resourceFolder;
|
resourceFolder = getExePath() + L"/" + resourceFolder;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
wxFileName fontFileName = wxFileName(resourceFolder, fontFile);
|
//full font file path
|
||||||
|
wxFileName fontFileName = wxFileName(resourceFolder + L"/" + fontFile);
|
||||||
|
|
||||||
|
// wxFileName fontFileName = wxFileName(resourceFolder, fontFile);
|
||||||
|
|
||||||
if (!fontFileName.Exists()) {
|
if (!fontFileName.Exists()) {
|
||||||
wxFileName exePath = wxFileName(wxStandardPaths::Get().GetExecutablePath());
|
wxFileName exePath = wxFileName(wxStandardPaths::Get().GetExecutablePath());
|
||||||
fontFileName = wxFileName(exePath.GetPath(), fontFile);
|
|
||||||
resourceFolder = exePath.GetPath();
|
//Full Path where the fonts are, including file name
|
||||||
|
fontFileName = wxFileName(exePath.GetPath() + L"/" + fontFile);
|
||||||
|
|
||||||
|
//Dir where the fonts are
|
||||||
|
resourceFolder = fontFileName.GetPath();
|
||||||
}
|
}
|
||||||
|
|
||||||
//overwrite with the full path
|
//overwrite with the full path
|
||||||
|
Loading…
Reference in New Issue
Block a user