merge Sinhala glyphs into original font file

This commit is contained in:
GyulyVGC 2026-07-09 13:50:51 +02:00
parent 7a2445073f
commit e44586a171
13 changed files with 61 additions and 27 deletions

View file

@ -6,7 +6,7 @@ All Sniffnet releases with the relative changes are documented in this file.
- Support CIDR ranges in imported IP blacklists ([#1181](https://github.com/GyulyVGC/sniffnet/pull/1181))
- Show number of IP addresses and CIDR ranges in imported IP blacklists ([#1183](https://github.com/GyulyVGC/sniffnet/pull/1183))
- Added Hungarian translation 🇭🇺 ([#1197](https://github.com/GyulyVGC/sniffnet/pull/1197))
- Added Sinhala (Sri Lanka) translation 🇱🇰 (with Noto Sans Sinhala font fallback)
- Added Sinhala translation 🇱🇰 ([#1239](https://github.com/GyulyVGC/sniffnet/pull/1239))
- Updated some of the existing translations to v1.5:
- Ukrainian ([#1039](https://github.com/GyulyVGC/sniffnet/pull/1039))
- German ([#1122](https://github.com/GyulyVGC/sniffnet/pull/1122))

View file

@ -319,6 +319,56 @@ z
ی
۰
۳
@ -356,6 +406,7 @@ z

View file

@ -12,11 +12,3 @@ grep -o --no-filename . ./src/**/* | sort -u > $FULL_FOLDER/$CHARACTERS_FILE
pyftsubset $FULL_FOLDER/$FONT_NAME.ttf --text-file=$FULL_FOLDER/$CHARACTERS_FILE --no-ignore-missing-unicodes
mv $FULL_FOLDER/$FONT_NAME.subset.ttf $SUBSET_FOLDER/$FONT_NAME.subset.ttf
# Subset Noto Sans Sinhala (OFL) to cover the Sinhala Unicode block and common
# zero-width joiners used for conjunct rendering.
# Font source: https://github.com/notofonts/noto-fonts (SIL Open Font License 1.1)
SINHALA_FONT=NotoSansSinhala-Regular
pyftsubset $FULL_FOLDER/$SINHALA_FONT.ttf \
--unicodes="U+0D80-0DFF,U+200C,U+200D,U+25CC" \
--output-file=$SUBSET_FOLDER/$SINHALA_FONT.subset.ttf

View file

@ -20,10 +20,6 @@ pub const SARASA_MONO: Font = Font {
pub const ICONS_BYTES: &[u8] = include_bytes!("../../../resources/fonts/subset/icons.ttf");
pub const ICONS: Font = Font::with_name(ICON_FONT_FAMILY_NAME);
// fallback font for Sinhala script
pub const NOTO_SANS_SINHALA_BYTES: &[u8] =
include_bytes!("../../../resources/fonts/subset/NotoSansSinhala-Regular.subset.ttf");
// font sizes
pub const FONT_SIZE_FOOTER: f32 = 14.3;
pub const FONT_SIZE_BODY: f32 = 16.8;

View file

@ -21,9 +21,7 @@ use translations::types::language::Language;
use utils::formatted_strings::print_cli_welcome_message;
use crate::gui::sniffer::FONT_FAMILY_NAME;
use crate::gui::styles::style_constants::{
ICONS_BYTES, NOTO_SANS_SINHALA_BYTES, SARASA_MONO_BYTES,
};
use crate::gui::styles::style_constants::{ICONS_BYTES, SARASA_MONO_BYTES};
use crate::gui::types::conf::CONF;
mod chart;
@ -84,11 +82,7 @@ pub fn main() -> iced::Result {
.settings(iced::Settings {
// id needed for Linux Wayland; should match StartupWMClass in .desktop file; see issue #292
id: Some(String::from(SNIFFNET_LOWERCASE)),
fonts: vec![
Cow::Borrowed(SARASA_MONO_BYTES),
Cow::Borrowed(ICONS_BYTES),
Cow::Borrowed(NOTO_SANS_SINHALA_BYTES),
],
fonts: vec![Cow::Borrowed(SARASA_MONO_BYTES), Cow::Borrowed(ICONS_BYTES)],
default_font: Font::with_name(FONT_FAMILY_NAME),
default_text_size: Pixels(FONT_SIZE_BODY),
antialiasing: true,

View file

@ -1695,7 +1695,7 @@ pub fn incoming_translation(language: Language) -> &'static str {
Language::ID => "Masuk",
Language::NL => "Inkomend",
Language::HU => "Beérkező",
Language::SI => "",
Language::SI => "",
}
}
@ -1725,7 +1725,7 @@ pub fn outgoing_translation(language: Language) -> &'static str {
Language::ID => "Keluar",
Language::NL => "Uitgaand",
Language::HU => "Kimenő",
Language::SI => "",
Language::SI => "",
}
}

View file

@ -181,7 +181,7 @@ pub fn host_translation(language: Language) -> &'static str {
Language::NL => "Netwerk host",
Language::EL => "Κόμβος δικτύου",
Language::HU => "Hálózati gazda",
Language::SI => "නෙට්වර්ක් හොස්ට් එ",
Language::SI => "නෙට්වර්ක් හොස්ට් එ",
}
}
@ -271,7 +271,7 @@ pub fn local_translation(language: Language) -> &'static str {
Language::NL => "Lokaal netwerk",
Language::EL => "Τοπικό δίκτυο",
Language::HU => "Helyi hálózat",
Language::SI => "ලෝකල් නෙට්වර්ක් එ",
Language::SI => "ලෝකල් නෙට්වර්ක් එ",
}
}
@ -425,7 +425,7 @@ pub fn source_translation(language: Language) -> &'static str {
Language::NL => "Bron",
Language::EL => "Πηγή",
Language::HU => "Forrás",
Language::SI => "ආරම්භ",
Language::SI => "ආරම්භ",
}
}

View file

@ -368,7 +368,7 @@ pub fn unsupported_link_type_translation(language: Language) -> &'static str {
Language::HU => {
"Az ezzel az adapterrel asszociált link típust még nem támogatja a Sniffnet..."
}
Language::SI => "මෙම ඇඩැප්ටරයට සම්බන්ධ සබැඳි වර්ගයට දැනට Sniffnet සහාය නොමැත.",
Language::SI => "මෙම ඇඩැප්ටරයට සම්බන්ධ සබැඳි වර්ගයට දැනට Sniffnet සහාය නොමැත...",
_ => "The link type associated with this adapter is not supported by Sniffnet yet...",
}
}

View file

@ -149,6 +149,7 @@ impl Language {
| Language::EL
| Language::HU
| Language::RU
| Language::SI
)
}
}