Use Noto font, not ZCOOL, because it has a full set of Chinese glyphs

This commit is contained in:
Dustin Carlino 2021-02-25 18:05:19 -08:00
parent 3019a6fff1
commit fb78ec19cd
5 changed files with 10 additions and 11 deletions

View File

@ -1480,10 +1480,10 @@
"uncompressed_size_bytes": 25964767, "uncompressed_size_bytes": 25964767,
"compressed_size_bytes": 8714926 "compressed_size_bytes": 8714926
}, },
"data/system/extra_fonts/ZCOOLXiaoWei-Regular.ttf": { "data/system/extra_fonts/NotoSerifCJKtc-Regular.otf": {
"checksum": "edea762b9f6ccee6d330ec37b6d1cd66", "checksum": "338584d1454293b6dfd84a9137153b3c",
"uncompressed_size_bytes": 6302056, "uncompressed_size_bytes": 23614420,
"compressed_size_bytes": 3409781 "compressed_size_bytes": 19085911
}, },
"data/system/fr/charleville_mezieres/city.bin": { "data/system/fr/charleville_mezieres/city.bin": {
"checksum": "a283fcc74ca4d6d2b471204440a7a20f", "checksum": "a283fcc74ca4d6d2b471204440a7a20f",

Binary file not shown.

View File

@ -41,20 +41,20 @@ impl MapLoader {
} }
// TODO Generalize this more, maybe with some kind of country code -> font config // TODO Generalize this more, maybe with some kind of country code -> font config
let zcool = "ZCOOLXiaoWei-Regular.ttf"; let chinese_font = "NotoSerifCJKtc-Regular.otf";
if name.city.country == "tw" && !ctx.is_font_loaded(zcool) { if name.city.country == "tw" && !ctx.is_font_loaded(chinese_font) {
return RawFileLoader::<A>::new( return RawFileLoader::<A>::new(
ctx, ctx,
abstio::path(format!("system/extra_fonts/{}", zcool)), abstio::path(format!("system/extra_fonts/{}", chinese_font)),
Box::new(move |ctx, app, bytes| match bytes { Box::new(move |ctx, app, bytes| match bytes {
Ok(bytes) => { Ok(bytes) => {
ctx.load_font(zcool, bytes); ctx.load_font(chinese_font, bytes);
Transition::Replace(MapLoader::new(ctx, app, name, on_load)) Transition::Replace(MapLoader::new(ctx, app, name, on_load))
} }
Err(err) => Transition::Replace(PopupMsg::new( Err(err) => Transition::Replace(PopupMsg::new(
ctx, ctx,
"Error", "Error",
vec![format!("Couldn't load {}", zcool), err.to_string()], vec![format!("Couldn't load {}", chinese_font), err.to_string()],
)), )),
}), }),
); );

View File

@ -39,8 +39,7 @@ Other binary data bundled in:
- Overpass font (<https://fonts.google.com/specimen/Overpass>, Open Font - Overpass font (<https://fonts.google.com/specimen/Overpass>, Open Font
License) License)
- Bungee fonts (<https://fonts.google.com/specimen/Bungee>, Open Font License) - Bungee fonts (<https://fonts.google.com/specimen/Bungee>, Open Font License)
- ZCOOL XiaoWei fonts (<https://fonts.google.com/specimen/ZCOOL+XiaoWei>, Open - Noto fonts (<https://www.google.com/get/noto>, SIL Open Font License)
Font License)
- Material Design icons (<https://material.io/resources/icons>, Apache license) - Material Design icons (<https://material.io/resources/icons>, Apache license)
- Some Graphics textures (<https://www.kenney.nl/>, CC0 1.0 Universal) - Some Graphics textures (<https://www.kenney.nl/>, CC0 1.0 Universal)
- Snowflake SVG (<https://www.svgrepo.com/page/licensing>, CC0) - Snowflake SVG (<https://www.svgrepo.com/page/licensing>, CC0)