mirror of
https://github.com/storytold/photocraft.git
synced 2026-12-02 06:20:48 +01:00
Drop crates/text font changes (now in #8812); add ka.tsv ATTRIBUTION row
Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01YMTAbGNRxnMEzRvYnQGphF
This commit is contained in:
1 parent
82b9447732
commit
dd10f81580
5 files changed
+7
-15
No files matched your search
@@ -32,6 +32,7 @@ next to them.
|
||||
| `crates/ui-egui/src/i18n/fi.tsv` | Finnish UI translations | @Janiz-zzz, @metuuu and PhotoCraft contributors | Original translations of PhotoCraft's English labels | MIT OR Apache-2.0, [`LICENSE-translations.txt`](crates/ui-egui/src/i18n/LICENSE-translations.txt) |
|
||||
| `crates/ui-egui/src/i18n/da.tsv` | Danish UI translations | @pechnikov2026-star and PhotoCraft contributors | Original translations of PhotoCraft's English labels | MIT OR Apache-2.0, [`LICENSE-translations.txt`](crates/ui-egui/src/i18n/LICENSE-translations.txt) |
|
||||
| `crates/ui-egui/src/i18n/nb.tsv` | Norwegian Bokmål UI translations | @nikolainyegaard, @Bolla76 and PhotoCraft contributors | Original translations of PhotoCraft's English labels | MIT OR Apache-2.0, [`LICENSE-translations.txt`](crates/ui-egui/src/i18n/LICENSE-translations.txt) |
|
||||
| `crates/ui-egui/src/i18n/ka.tsv` | Georgian UI translations | @devius with Claude Code, AI-assisted | Original translations of PhotoCraft's English labels | MIT OR Apache-2.0, [`LICENSE-translations.txt`](crates/ui-egui/src/i18n/LICENSE-translations.txt) |
|
||||
| `epaint_default_fonts::EGUI_ICONS` (build input; deflated into `OUT_DIR/egui_fonts/egui-icons.ttf.deflate`, registered by `crates/ui-egui/src/egui_fonts.rs`) | egui-icons, five-glyph subset of emoji-icon-font | John Slegers | [egui fork at 6d518fc](https://github.com/storytold/egui/tree/6d518fc799681571963842f95b55a6b68431b15a/crates/epaint_default_fonts/fonts), [original](https://github.com/jslegers/emoji-icon-font); egui subset, unmodified here | MIT; Copyright (c) 2014 John Slegers; full upstream notice in [NOTICE](NOTICE) |
|
||||
| `assets/fonts/Inter-Regular.ttf`, `Inter-Medium.ttf`, `Inter-SemiBold.ttf` | Inter 4.001 (UI font) | The Inter Project Authors (Rasmus Andersson) | <https://github.com/rsms/inter> | SIL OFL 1.1, [`assets/fonts/OFL-Inter.txt`](assets/fonts/OFL-Inter.txt) |
|
||||
| `assets/fonts/JetBrainsMono-Regular.ttf` | JetBrains Mono 2.305 (numeric font) | The JetBrains Mono Project Authors | <https://github.com/JetBrains/JetBrainsMono> | SIL OFL 1.1, [`assets/fonts/OFL-JetBrainsMono.txt`](assets/fonts/OFL-JetBrainsMono.txt) |
|
||||
|
||||
@@ -78,9 +78,6 @@ pub const LAO_FAMILIES: &[&str] = &["Lao Sangam MN", "Lao MN", "Lao UI", "Noto S
|
||||
/// Myanmar/Burmese-capable families: macOS (Myanmar Sangam MN, Myanmar MN), Windows (Myanmar Text)
|
||||
/// and Linux (Noto).
|
||||
pub const MYANMAR_FAMILIES: &[&str] = &["Myanmar Sangam MN", "Myanmar MN", "Myanmar Text", "Noto Sans Myanmar"];
|
||||
/// Georgian-capable families: craft-fonts and Linux (Noto), Windows (Sylfaen), macOS (".SF Georgian",
|
||||
/// a hidden system face). Georgian in a font without Mkhedruli glyphs falls back to these.
|
||||
pub const GEORGIAN_FAMILIES: &[&str] = &["Noto Sans Georgian", "Noto Serif Georgian", "Sylfaen", ".SF Georgian"];
|
||||
/// Indic-script families for document text. Windows has `Nirmala UI` for all nine scripts (from
|
||||
/// Windows 8); macOS has the Kohinoor and Sangam MN families; Linux has Noto Sans. Indic text in a
|
||||
/// font without these glyphs had no candidate to fall back to and drew .notdef boxes (#218).
|
||||
@@ -124,7 +121,6 @@ pub fn fallback_candidates(order: &[crate::cjk::CjkScript; 4]) -> Vec<&'static s
|
||||
v.extend_from_slice(KHMER_FAMILIES);
|
||||
v.extend_from_slice(LAO_FAMILIES);
|
||||
v.extend_from_slice(MYANMAR_FAMILIES);
|
||||
v.extend_from_slice(GEORGIAN_FAMILIES);
|
||||
for fams in INDIC_FAMILIES {
|
||||
for f in *fams {
|
||||
// Nirmala UI covers all nine scripts and is listed by each; probe it once.
|
||||
|
||||
@@ -106,7 +106,7 @@ impl Script {
|
||||
],
|
||||
Hebrew => &["notosanshebrew", "notoserifhebrew", "segoeui", "arialhb", "sfhebrew", "dejavusans", "arial", "freesans", "culmus"],
|
||||
Armenian => &["notosansarmenian", "notoserifarmenian", "segoeui", "sylfaen", "mshtakan", "dejavusans", "freesans"],
|
||||
Georgian => &["notosansgeorgian", "notoserifgeorgian", "segoeui", "sylfaen", "sfgeorgian", "dejavusans", "freesans"],
|
||||
Georgian => &["notosansgeorgian", "notoserifgeorgian", "segoeui", "sylfaen", "dejavusans", "freesans"],
|
||||
Ethiopic => &["notosansethiopic", "notoserifethiopic", "ebrima", "kefa", "abyssinicasil"],
|
||||
Devanagari => &[
|
||||
"notosansdevanagari",
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
//!
|
||||
//! Script fallback: the manifest's `scripts` field says which scripts a font is for. The first
|
||||
//! served family listed for a script the bundled fonts don't cover (Arabic, Hebrew, Devanagari,
|
||||
//! Thai, Khmer, Lao, Burmese, Georgian, Japanese, Chinese, Korean) is that script's fallback: text in that script asks for it
|
||||
//! Thai, Khmer, Lao, Burmese, Japanese, Chinese, Korean) is that script's fallback: text in that script asks for it
|
||||
//! ([`request_for_text`], from layout), the font database puts it in the fallback stack once it
|
||||
//! arrives, and the web shell asks up front for the scripts of the browser's languages
|
||||
//! ([`request_for_languages`]). The manifest's SHA-256 becomes the fetch's Subresource Integrity
|
||||
@@ -98,7 +98,7 @@ pub fn is_relative_path(p: &str) -> bool {
|
||||
|
||||
/// The scripts a served font can be the fallback for: those the bundled fonts (Inter, which covers
|
||||
/// Latin, Greek and Cyrillic) lack, as ISO 15924 codes.
|
||||
const FALLBACK_SCRIPTS: &[&str] = &["Arab", "Hebr", "Deva", "Thai", "Khmr", "Laoo", "Mymr", "Geor", "Jpan", "Hans", "Hant", "Kore"];
|
||||
const FALLBACK_SCRIPTS: &[&str] = &["Arab", "Hebr", "Deva", "Thai", "Khmr", "Laoo", "Mymr", "Jpan", "Hans", "Hant", "Kore"];
|
||||
|
||||
/// The script fallbacks in `fonts`: for each script in [`FALLBACK_SCRIPTS`], the first family in
|
||||
/// manifest order that lists it, as `(script, family)` in order of first appearance.
|
||||
@@ -134,7 +134,6 @@ pub fn script_of(c: char, order: &[crate::cjk::CjkScript; 4]) -> Option<&'static
|
||||
0x1780..=0x17FF | 0x19E0..=0x19FF => "Khmr",
|
||||
0x0E80..=0x0EFF => "Laoo",
|
||||
0x1000..=0x109F | 0xA9E0..=0xA9FF | 0xAA60..=0xAA7F => "Mymr",
|
||||
0x10A0..=0x10FF | 0x1C90..=0x1CBF | 0x2D00..=0x2D2F => "Geor",
|
||||
_ => return None,
|
||||
})
|
||||
}
|
||||
@@ -153,7 +152,6 @@ pub fn language_script(tag: &str) -> Option<&'static str> {
|
||||
"km" => "Khmr",
|
||||
"lo" => "Laoo",
|
||||
"my" => "Mymr",
|
||||
"ka" => "Geor",
|
||||
"ja" => "Jpan",
|
||||
"ko" => "Kore",
|
||||
"zh" if rest.iter().any(|r| matches!(*r, "hant" | "tw" | "hk" | "mo")) => "Hant",
|
||||
@@ -476,7 +474,6 @@ mod tests {
|
||||
('ລ', Some("Laoo")),
|
||||
('မ', Some("Mymr")),
|
||||
('ၡ', Some("Mymr")),
|
||||
('ა', Some("Geor")),
|
||||
('あ', Some("Jpan")),
|
||||
('한', Some("Kore")),
|
||||
] {
|
||||
@@ -499,7 +496,6 @@ mod tests {
|
||||
("km-KH", Some("Khmr")),
|
||||
("lo", Some("Laoo")),
|
||||
("my-MM", Some("Mymr")),
|
||||
("ka-GE", Some("Geor")),
|
||||
("ja-JP", Some("Jpan")),
|
||||
("zh-CN", Some("Hans")),
|
||||
("zh-TW", Some("Hant")),
|
||||
|
||||
@@ -2194,13 +2194,12 @@ fn craft_fonts_cover_japanese_without_system_fonts() {
|
||||
assert!(craft_family_of(&l).is_empty());
|
||||
}
|
||||
|
||||
/// Chinese, Arabic, Thai and Georgian set in Inter fall back to the craft font for their script when
|
||||
/// the build has one (Noto Sans CJK SC, Noto Sans Arabic, Noto Sans Thai and Noto Sans Georgian in
|
||||
/// newer craft-fonts).
|
||||
/// Chinese, Arabic and Thai set in Inter fall back to the craft font for their script when the
|
||||
/// build has one (Noto Sans CJK SC, Noto Sans Arabic and Noto Sans Thai in newer craft-fonts).
|
||||
#[test]
|
||||
fn craft_fonts_cover_their_other_scripts_without_system_fonts() {
|
||||
let mut e = TextEngine::new();
|
||||
for (script, text) in [("Hans", "中文图层"), ("Arab", "مرحبا"), ("Thai", "ภาษาไทย"), ("Geor", "ქართული შრე")] {
|
||||
for (script, text) in [("Hans", "中文图层"), ("Arab", "مرحبا"), ("Thai", "ภาษาไทย")] {
|
||||
if !crate::CRAFT_FONTS.iter().any(|f| f.scripts.contains(&script)) {
|
||||
eprintln!("skipping {script}: built without a craft font for it (set CRAFT_FONTS_DIR to a craft-fonts checkout)");
|
||||
continue;
|
||||
|
||||
Reference in new issue
Block a user