chore(release): v0.1.5 - Linux ksni tray, 1:1 sidebar collapse button, zero-overhead Linux RAM tuning
This commit is contained in:
parent
f063382410
commit
ee65d23b2a
9 changed files with 684 additions and 48 deletions
|
|
@ -332,8 +332,25 @@ impl TextEngine {
|
|||
|
||||
db.set_sans_serif_family(&ys_text_family);
|
||||
|
||||
// Load system fallback fonts for rare symbols / emoji / CJK
|
||||
db.load_system_fonts();
|
||||
// On Linux, avoid indexing all 400+ system fonts (saves 20-40 MB RSS from Noto CJK/Emoji);
|
||||
// load only 1-2 lean symbol/fallback faces alongside our 4 embedded official Yandex fonts.
|
||||
#[cfg(target_os = "linux")]
|
||||
{
|
||||
for path in [
|
||||
"/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf",
|
||||
"/usr/share/fonts/truetype/liberation/LiberationSans-Regular.ttf",
|
||||
"/usr/share/fonts/truetype/noto/NotoSansSymbols2-Regular.ttf",
|
||||
] {
|
||||
if std::path::Path::new(path).is_file() {
|
||||
let _ = db.load_font_file(path);
|
||||
}
|
||||
}
|
||||
}
|
||||
#[cfg(not(target_os = "linux"))]
|
||||
{
|
||||
// Load system fallback fonts for rare symbols / emoji / CJK
|
||||
db.load_system_fonts();
|
||||
}
|
||||
|
||||
let font_system = FontSystem::new_with_locale_and_db("ru-RU".to_string(), db);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue