mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-29 01:34:29 +01:00
Merge pull request #9058 from dotCooCoo/fix/issue-8583
Part of #8583: document tab titles draw in a condensed face, so more tabs fit
This commit is contained in:
6 files changed
+28
-4
No files matched your search
@@ -33,7 +33,7 @@ Generated-in-code art is original and has no file to list. This covers the defau
|
||||
|
||||
**Font files are never committed here.** Fonts shared by the Crafting Apps live in [storytold/craft-fonts](https://github.com/storytold/craft-fonts). The small Latin UI/document fonts below predate that rule and stay.
|
||||
|
||||
**Optional build input: craft-fonts.** Builds made with `CRAFT_FONTS_DIR=<craft-fonts checkout>` (all official releases) embed the Japanese fonts listed in its [`ATTRIBUTION.md`](https://github.com/storytold/craft-fonts/blob/main/ATTRIBUTION.md): BIZ UDPGothic Regular and Bold, Shippori Mincho Regular and BIZ UDMincho Regular (web builds: BIZ UDPGothic Regular only), all under the SIL Open Font License 1.1. They are not files in this repository; release packages carry each one's `OFL-<family>.txt`. Builds without `CRAFT_FONTS_DIR` embed none of them.
|
||||
**Optional build input: craft-fonts.** Builds made with `CRAFT_FONTS_DIR=<craft-fonts checkout>` (all official releases) embed the Japanese fonts listed in its [`ATTRIBUTION.md`](https://github.com/storytold/craft-fonts/blob/main/ATTRIBUTION.md): BIZ UDPGothic Regular and Bold, Shippori Mincho Regular and BIZ UDMincho Regular (web builds: BIZ UDPGothic Regular only), all under the SIL Open Font License 1.1. They are not files in this repository; release packages carry each one's `OFL-<family>.txt`. Builds without `CRAFT_FONTS_DIR` embed none of them. Desktop builds with a checkout whose opt-in `fonts/latin-manifest.txt` lists Noto Sans Condensed SemiBold (The Noto Project Authors, SIL Open Font License 1.1, from the [notofonts/latin-greek-cyrillic NotoSans-v2.015 release](https://github.com/notofonts/latin-greek-cyrillic/releases/tag/NotoSans-v2.015)) also embed that face, for document tab titles.
|
||||
|
||||
| Asset | Author | Source | Licence | Notes |
|
||||
|---|---|---|---|---|
|
||||
|
||||
@@ -45,6 +45,8 @@ fonts listed in https://github.com/storytold/craft-fonts/blob/main/ATTRIBUTION.m
|
||||
Shippori Mincho, BIZ UDMincho, Noto Sans CJK SC and Noto Sans Arabic in the current manifest;
|
||||
web builds BIZ UDPGothic Regular only) under the SIL
|
||||
Open Font License 1.1. Their license texts ship with the release packages as OFL-<family>.txt.
|
||||
Desktop builds with a craft-fonts checkout whose fonts/latin-manifest.txt lists Noto Sans Condensed
|
||||
SemiBold (Copyright 2022 The Noto Project Authors, SIL Open Font License 1.1) also embed that face.
|
||||
|
||||
PDF import decodes CJK text with Adobe's CMap resources (https://github.com/adobe-type-tools/cmap-resources),
|
||||
compiled into the app through the hayro-cmap crate under the BSD 3-Clause License:
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
//! The optional craft-fonts build input (https://github.com/storytold/craft-fonts,
|
||||
//! `docs/integration.md`): with `CRAFT_FONTS_DIR=<checkout>` set, every font in its
|
||||
//! `fonts/manifest.txt` is embedded as `CRAFT_FONTS` (the framework's `craft_fonts_build::Embed`);
|
||||
//! unset, `CRAFT_FONTS` is empty and the app uses its own and the installed fonts.
|
||||
//! unset, `CRAFT_FONTS` is empty and the app uses its own and the installed fonts. Desktop builds
|
||||
//! also embed the Noto Sans Condensed SemiBold row of the checkout's `fonts/latin-manifest.txt`
|
||||
//! (`Embed::tab_face`), which document tab titles draw in; a checkout without it gives a warning.
|
||||
//! `CRAFT_FONTS_REQUIRED=1` turns a bad checkout into a build error (release builds). Nothing is
|
||||
//! fetched: the build reads only the local checkout.
|
||||
//!
|
||||
@@ -40,7 +42,10 @@ fn main() {
|
||||
None => embed,
|
||||
}
|
||||
};
|
||||
if let Err(e) = fonts().filter(move |f| !wasm || (f.family == WEB_FONT.0 && f.style == WEB_FONT.1)).write("craft_fonts.rs") {
|
||||
// Desktop builds also embed the checkout's condensed face for document tab titles.
|
||||
let embedded = fonts().filter(move |f| !wasm || (f.family == WEB_FONT.0 && f.style == WEB_FONT.1));
|
||||
let embedded = if wasm { embedded } else { embedded.tab_face() };
|
||||
if let Err(e) = embedded.write("craft_fonts.rs") {
|
||||
println!("cargo::error={e}");
|
||||
}
|
||||
let mut web = String::new();
|
||||
|
||||
@@ -72,6 +72,7 @@ fn japanese_document_fonts_from(fonts: &[EmbeddedFace]) -> Vec<&EmbeddedFace> {
|
||||
/// first: the fallback for Arabic text; the other families are picked by name), then the Thai ones
|
||||
/// (Noto Sans Thai: the fallback for Thai text where no Thai font is installed, and on the web),
|
||||
/// then the Georgian ones (Noto Sans Georgian, the same for Georgian). Remaining faces follow in manifest order, so every explicitly supplied family can be selected.
|
||||
/// The tab-title face (role `tab`), which only document tab titles draw in, is left out.
|
||||
/// Empty when built without craft-fonts.
|
||||
pub fn document_fonts() -> Vec<&'static EmbeddedFace> {
|
||||
document_fonts_from(CRAFT_FONTS)
|
||||
@@ -79,7 +80,9 @@ pub fn document_fonts() -> Vec<&'static EmbeddedFace> {
|
||||
|
||||
fn document_fonts_from(fonts: &[EmbeddedFace]) -> Vec<&EmbeddedFace> {
|
||||
let mut v = japanese_document_fonts_from(fonts);
|
||||
let rest = |f: &&EmbeddedFace, earlier: &[&str]| !f.has_script("Jpan") && !earlier.iter().any(|s| f.has_script(s));
|
||||
let rest = |f: &&EmbeddedFace, earlier: &[&str]| {
|
||||
f.role != Some(craft_fonts_build::TAB_ROLE) && !f.has_script("Jpan") && !earlier.iter().any(|s| f.has_script(s))
|
||||
};
|
||||
v.extend(fonts.iter().filter(|f| f.has_script("Arab") && rest(f, &[])));
|
||||
v.extend(fonts.iter().filter(|f| f.has_script("Thai") && rest(f, &["Arab"])));
|
||||
v.extend(fonts.iter().filter(|f| f.has_script("Geor") && rest(f, &["Arab", "Thai"])));
|
||||
@@ -131,6 +134,14 @@ mod tests {
|
||||
assert!(document_fonts_from(&[]).is_empty());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn document_fonts_leave_out_the_tab_title_face() {
|
||||
let latin = EmbeddedFace { family: "Latin", style: "Regular", scripts: &["Latn"], index: 0, bytes: &[], role: None };
|
||||
let tab = EmbeddedFace { family: "Noto Sans", style: "Condensed SemiBold", role: Some(craft_fonts_build::TAB_ROLE), ..latin };
|
||||
let listed: Vec<_> = document_fonts_from(&[latin, tab]).into_iter().map(|f| f.family).collect();
|
||||
assert_eq!(listed, ["Latin"]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn web_fonts_follow_the_list() {
|
||||
if CRAFT_FONTS.is_empty() {
|
||||
|
||||
@@ -178,6 +178,11 @@ CRAFT_FONTS_DIR="$PWD/../craft-fonts" cargo xtask ci # also runs the Japanese-
|
||||
`startup` and `demand` faces of `crates/text/web-fonts.txt` are served under `fonts/ui/`
|
||||
instead: the stack fetches the UI language's at once and the others the first time text needs
|
||||
them.
|
||||
- Document tab titles: desktop builds also embed the Noto Sans Condensed SemiBold row of the
|
||||
checkout's opt-in `fonts/latin-manifest.txt` (`Embed::tab_face` in `crates/text/build.rs`).
|
||||
The interface font stack draws document tab titles in it, scaled to the x-height of the
|
||||
semibold face; the document font list leaves it out. Without `CRAFT_FONTS_DIR`, on the web, or
|
||||
with a checkout that lacks the row (a build warning), tab titles draw in the semibold face.
|
||||
- Tests that need Japanese or Georgian glyphs skip with a message when built without craft-fonts. The FreeBSD
|
||||
CI job and every release job (`release.yml`) check craft-fonts out at a pinned commit; release
|
||||
packages carry each embedded font's `OFL-<family>.txt`.
|
||||
|
||||
@@ -454,6 +454,7 @@ next unit in the order a right-click on a ruler lists them, from Feet back to Po
|
||||
| A middle-click on a document tab or its × closes it as the × does; closing a modified document's last view asks to save first (VectorCraft addition, as in PhotoCraft) | done | #6506; `chrome::tests::a_middle_click_on_a_tab_closes_it_as_the_close_box_does`; not scored |
|
||||
| When the document tabs don't all fit, the first tab that doesn't fit whole fills the room before the » button with its title shortened and ending in "…", once that room leaves at least 40 pt for the title; with the active tab among the last ones, the tab before the ones shown fills the room left at the start instead; an active tab wider than the strip is shortened to it, and a tab narrower than 25 pt shows no ×; the tooltip of a shortened tab shows the whole title, wrapped to the window (VectorCraft's own rule) | done | #8584; `tests::tab_overflow`; not scored |
|
||||
| An inactive document tab shows the document's name, the view number and the unsaved-changes mark, without the zoom and the mode in parentheses (the color mode and view, or the opacity mask being edited); the active tab keeps its whole title, and an inactive tab's tooltip shows the whole title (VectorCraft's own rule) | done | #8582; `tests::tab_overflow::inactive_tabs_show_the_name_alone_so_more_tabs_fit`; not scored |
|
||||
| Document tab titles draw in a condensed face (craft-fonts' Noto Sans Condensed SemiBold) at the x-height of the interface's semibold face, so more tabs fit; builds without that face draw them in the semibold face (VectorCraft's own rule) | done; release builds pending | #8583; craft-ui's `TypeRole::TabTitle` and `craft_fonts_build::Embed::tab_face`; `craft_fonts::tests::document_fonts_leave_out_the_tab_title_face`; the release and FreeBSD workflows pin a craft-fonts commit without the face, so official builds draw tab titles in the semibold face until that pin moves past storytold/craft-fonts#72; not scored |
|
||||
| Panels hidden by Tab or Shift+Tab show for a while when the pointer rests on the left or right edge of the window, over the canvas, and hide again when it moves away; Tab shows them for good | done | Part of #5661; `window.panels.peek` ([Workspace basics](https://web.archive.org/web/2014/https://helpx.adobe.com/illustrator/using/workspace-basics.html), "Hide or show all panels"); VectorCraft's own choices: the 6 pt band and the 0.3 s delays, only the docked panels on that side show (floating panels, Tools and the Control bar stay hidden), and nothing shows in Presentation Mode; `panel_docking::tests::resting_on_the_right_edge_shows_the_hidden_panels_over_the_canvas_until_the_pointer_leaves` and the tests after it |
|
||||
|
||||
| Behaviour | Status | Notes |
|
||||
|
||||
Reference in new issue
Block a user