Skip to content

Commit

Permalink
save space by making Simplified Chinese optional
Browse files Browse the repository at this point in the history
  • Loading branch information
woelper committed Jan 12, 2025
1 parent 45caafa commit 5465626
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
authors = ["Johann Woelper <woelper@gmail.com>"]
description = "A minimalistic image viewer with analysis and editing tools"
edition = "2021"
exclude = ["res/*.gif", "tests/*", "res/screenshots/*", "res/previews/*"]
exclude = [".github/*", "res/fonts/NotoSansSC-Regular.ttf", "res/icons/*", "res/*.svg", "res/premult.png", "res/screen*.png","res/*.avif", "res/*.gif", "tests/*", "res/screenshots/*", "res/previews/*"]
keywords = ["graphics", "image", "viewer"]
license = "MIT"
name = "oculante"
Expand Down Expand Up @@ -115,6 +115,7 @@ update = ["self_update"]
j2k = ["jpeg2k"]
jxlcms = ["jxl-oxide/lcms2"]
hdr = []
lang_support = []


[target.'cfg(target_os = "macos")'.dependencies]
Expand Down
22 changes: 12 additions & 10 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -376,16 +376,18 @@ fn init(_app: &mut App, gfx: &mut Graphics, plugins: &mut Plugins) -> OculanteSt
.unwrap()
.insert(2, "noto_ar".to_owned());

fonts.font_data.insert(
"noto_sc".to_owned(),
FontData::from_static(include_bytes!("../res/fonts/NotoSansSC-Regular.ttf")),
);

fonts
.families
.get_mut(&FontFamily::Proportional)
.unwrap()
.insert(2, "noto_sc".to_owned());
#[cfg(feature = "lang_support")]
{
fonts.font_data.insert(
"noto_sc".to_owned(),
FontData::from_static(include_bytes!("../res/fonts/NotoSansSC-Regular.ttf")),
);
fonts
.families
.get_mut(&FontFamily::Proportional)
.unwrap()
.insert(2, "noto_sc".to_owned());
}

debug!("Theme {:?}", state.persistent_settings.theme);
apply_theme(&mut state, ctx);
Expand Down

0 comments on commit 5465626

Please sign in to comment.