Add open-source shared fonts

This commit is contained in:
fearlessTobi
2018-09-08 21:10:28 +02:00
parent fbaefc47a0
commit 51e4bdfaaa
11 changed files with 111695 additions and 2 deletions

View File

@@ -43,6 +43,9 @@ target_include_directories(mbedtls PUBLIC ./mbedtls/include)
add_library(microprofile INTERFACE)
target_include_directories(microprofile INTERFACE ./microprofile)
# Open Source Archives
add_subdirectory(open_source_archives)
# Unicorn
add_library(unicorn-headers INTERFACE)
target_include_directories(unicorn-headers INTERFACE ./unicorn/include)

View File

@@ -0,0 +1,3 @@
add_library(open_source_archives INTERFACE)
target_include_directories(open_source_archives INTERFACE "include/")

View File

@@ -0,0 +1,4 @@
These files were generated by https://github.com/FearlessTobi/yuzu_system_archives at git commit 0a24b0c9f38d71fb2c4bba5645a39029e539a5ec. To generate the files use the run.sh inside that repository.
The follwing system archives are currently included:
- JPN/EUR/USA System Font

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -388,7 +388,7 @@ add_library(core STATIC
create_target_directory_groups(core)
target_link_libraries(core PUBLIC common PRIVATE audio_core video_core)
target_link_libraries(core PUBLIC Boost::boost PRIVATE fmt lz4_static mbedtls opus unicorn)
target_link_libraries(core PUBLIC Boost::boost PRIVATE fmt lz4_static mbedtls opus unicorn open_source_archives)
if (ARCHITECTURE_x86_64)
target_sources(core PRIVATE

View File

@@ -13,6 +13,13 @@
#include "core/hle/service/filesystem/filesystem.h"
#include "core/hle/service/ns/pl_u.h"
#include "FontChineseSimplified.ttf.h"
#include "FontChineseTraditional.ttf.h"
#include "FontExtendedChineseSimplified.ttf.h"
#include "FontKorean.ttf.h"
#include "FontNintendoExtended.ttf.h"
#include "FontStandard.ttf.h"
namespace Service::NS {
enum class FontArchives : u64 {
@@ -218,7 +225,24 @@ PL_U::PL_U() : ServiceFramework("pl:u") {
file.ReadBytes(shared_font->data(), shared_font->size());
BuildSharedFontsRawRegions(*shared_font);
} else {
LOG_WARNING(Service_NS, "Unable to load shared font: {}", filepath);
LOG_WARNING(Service_NS,
"Shared Font file missing. Loading open source replacement from memory");
std::vector<std::vector<u8>> open_source_shared_fonts_ttf;
// clang-format off
open_source_shared_fonts_ttf.push_back(std::vector<u8>(std::begin(FontChineseSimplified), std::end(FontChineseSimplified)));
open_source_shared_fonts_ttf.push_back(std::vector<u8>(std::begin(FontChineseTraditional), std::end(FontChineseTraditional)));
open_source_shared_fonts_ttf.push_back(std::vector<u8>(std::begin(FontExtendedChineseSimplified),std::end(FontExtendedChineseSimplified)));
open_source_shared_fonts_ttf.push_back(std::vector<u8>(std::begin(FontKorean), std::end(FontKorean)));
open_source_shared_fonts_ttf.push_back(std::vector<u8>(std::begin(FontNintendoExtended), std::end(FontNintendoExtended)));
open_source_shared_fonts_ttf.push_back(std::vector<u8>(std::begin(FontStandard), std::end(FontStandard)));
// clang-format on
for (std::vector<u8> font_ttf : open_source_shared_fonts_ttf) {
FontRegion region{static_cast<u32>(offset + 8), static_cast<u32>(font_ttf.size())};
EncryptSharedFont(font_ttf, *shared_font, offset);
SHARED_FONT_REGIONS.push_back(region);
}
}
}
}