Unity 2017 compatibility for fonts

This commit is contained in:
Tellow Krinkle
2020-06-22 01:26:45 -05:00
parent ba94a77a48
commit f5177091c9
2 changed files with 10 additions and 1 deletions

View File

@@ -242,7 +242,12 @@ if len(sys.argv) > 4:
atlasOut += atlasName
atlasRest = atlas.rest()
emptyAtlasPoint = findEmptyAtlasPoint(atlasRest, 13)
atlasOut += atlasRest
if len(sys.argv) > 5 and sys.argv[5] == "2017":
atlasOut += atlasRest[:40]
atlasOut += atlasRest[40:44] * 3 # Unity 2017 split m_wrap into U, V, and W
atlasOut += atlasRest[44:]
else:
atlasOut += atlasRest
with open(originalFN, "rb") as originalFile:
original = FontFile(originalFile.read(), originalFN)

View File

@@ -106,6 +106,8 @@ fn main() {
font_path = format!("assets/vanilla/{}/msgothic_0.dat", &chapter);
}
let unity_ver_str = if *arc_number >= 8 { "2017" } else { "5" };
let status = Command::new("python")
.env("PYTHONIOENCODING", "utf-8")
.arg("scripts/TMPAssetConverter.py")
@@ -113,6 +115,7 @@ fn main() {
.arg("assets/fonts/msgothic_0 SDF_TextMeshProFont.dat")
.arg(font_path)
.arg(&directory_assets)
.arg(&unity_ver_str)
.status()
.expect("failed to execute TMPAssetConverter.py");
@@ -130,6 +133,7 @@ fn main() {
.arg("assets/fonts/msgothic_2 SDF_TextMeshProFont.dat")
.arg(font_path)
.arg(&directory_assets)
.arg(&unity_ver_str)
.status()
.expect("failed to execute TMPAssetConverter.py");