summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/CMakeLists.txt2
-rw-r--r--src/core/hle/service/ns/pl_u.cpp26
2 files changed, 26 insertions, 2 deletions
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index 7ddc87539..26f727d96 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -388,7 +388,7 @@ add_library(core STATIC
388create_target_directory_groups(core) 388create_target_directory_groups(core)
389 389
390target_link_libraries(core PUBLIC common PRIVATE audio_core video_core) 390target_link_libraries(core PUBLIC common PRIVATE audio_core video_core)
391target_link_libraries(core PUBLIC Boost::boost PRIVATE fmt lz4_static mbedtls opus unicorn) 391target_link_libraries(core PUBLIC Boost::boost PRIVATE fmt lz4_static mbedtls opus unicorn open_source_archives)
392 392
393if (ARCHITECTURE_x86_64) 393if (ARCHITECTURE_x86_64)
394 target_sources(core PRIVATE 394 target_sources(core PRIVATE
diff --git a/src/core/hle/service/ns/pl_u.cpp b/src/core/hle/service/ns/pl_u.cpp
index 878bbe439..77f635ae2 100644
--- a/src/core/hle/service/ns/pl_u.cpp
+++ b/src/core/hle/service/ns/pl_u.cpp
@@ -2,6 +2,13 @@
2// Licensed under GPLv2 or any later version 2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include <FontChineseSimplified.ttf.h>
6#include <FontChineseTraditional.ttf.h>
7#include <FontExtendedChineseSimplified.ttf.h>
8#include <FontKorean.ttf.h>
9#include <FontNintendoExtended.ttf.h>
10#include <FontStandard.ttf.h>
11
5#include "common/common_paths.h" 12#include "common/common_paths.h"
6#include "common/file_util.h" 13#include "common/file_util.h"
7#include "core/core.h" 14#include "core/core.h"
@@ -218,7 +225,24 @@ PL_U::PL_U() : ServiceFramework("pl:u") {
218 file.ReadBytes(shared_font->data(), shared_font->size()); 225 file.ReadBytes(shared_font->data(), shared_font->size());
219 BuildSharedFontsRawRegions(*shared_font); 226 BuildSharedFontsRawRegions(*shared_font);
220 } else { 227 } else {
221 LOG_WARNING(Service_NS, "Unable to load shared font: {}", filepath); 228 LOG_WARNING(Service_NS,
229 "Shared Font file missing. Loading open source replacement from memory");
230
231 const std::vector<std::vector<u8>> open_source_shared_fonts_ttf = {
232 {std::begin(FontChineseSimplified), std::end(FontChineseSimplified)},
233 {std::begin(FontChineseTraditional), std::end(FontChineseTraditional)},
234 {std::begin(FontExtendedChineseSimplified),
235 std::end(FontExtendedChineseSimplified)},
236 {std::begin(FontNintendoExtended), std::end(FontNintendoExtended)},
237 {std::begin(FontStandard), std::end(FontStandard)},
238 };
239
240 for (const std::vector<u8>& font_ttf : open_source_shared_fonts_ttf) {
241 const FontRegion region{static_cast<u32>(offset + 8),
242 static_cast<u32>(font_ttf.size())};
243 EncryptSharedFont(font_ttf, *shared_font, offset);
244 SHARED_FONT_REGIONS.push_back(region);
245 }
222 } 246 }
223 } 247 }
224} 248}