M7: find New York, macOS's hidden .New York, under its public name

macOS installs Apple's serif New York as `.New York`; a leading dot keeps
it out of font menus, and the scan drops dot families except those in
`public_family`. New York wasn't one, so "New York" was a missing font
and text drew in a fallback. It now joins SF Compact and SF Pro Rounded
there.

Tests: the mapping, and a Mac-only scan of /System/Library/Fonts that
finds New York, keeps dot names out of the list and loads Regular and
Italic as "New York" (skipped where the files are absent).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
bjurrun
2026-11-24 20:22:18 +01:00
co-authored by Claude Opus 5.5
parent c01d391df7
commit 747dae244f
3 changed files with 24 additions and 0 deletions
+1
View File
@@ -366,6 +366,7 @@ Ranked; detail and milestones in [`docs/roadmap.md`](docs/roadmap.md).
| Date | Change | Summary |
|---|---|---|
| 2026-11-24 | minor | M7: New York, Apple's serif that macOS installs as the hidden `.New York`, is found and listed under its public name (it was a missing font). Numbers unchanged. |
| 2026-11-18 | minor | M8: design context for AI agents. `inspect.designContext` and the MCP tool `design_context` read the selection (or `ids`, or a `scope`) in one call: a tree where each layer keeps apart `explicit` values, `derived` ones layout worked out and `unsupported` ones with no direct CSS equivalent, joined with the variables (every mode's stored and resolved value), styles, components, fonts and assets it uses, and what the design leaves `missing`. A connected instance gives its code instead of its layers, and a result that wouldn't fit the client asks for fewer layers. Numbers unchanged |
| 2026-11-18 | minor | M3, gap 10: library analytics count insertions and detachments of styles and variables. Applying one, or copying or duplicating content that uses it, inserts it; the Detach button detaches it; an instance counts as its component alone. Show usage and `library.usage` give them per style and variable over the chosen period. Modes aren't counted. Numbers unchanged. Tests: `library_asset_counts_tests`, `library_assets_tests`. |
| 2026-11-18 | minor | M9, gap 6: the browser build uses team libraries and plugin directories on a server, through its WebSocket requests: adding a library by its link, its styles and components, publishing to it, Show usage and the reports a file sends; browsing a directory and installing from it, for the page only. Scripts through `window.figcraft` still can't, as commands there don't wait for the server. Numbers unchanged. Tests: `exchange_tests`. |
+2
View File
@@ -1515,6 +1515,8 @@ fn public_family(family: &str) -> Option<String> {
match hidden {
"SF Compact" | "SF Compact Rounded" => Some(hidden.to_string()),
"SF NS Rounded" => Some("SF Pro Rounded".into()),
// Apple's serif, also published as a download; macOS installs it as `.New York`.
"New York" => Some(hidden.to_string()),
_ => None,
}
}
+21
View File
@@ -461,10 +461,31 @@ fn hidden_apple_families_take_public_names() {
assert_eq!(public_family(".SF Compact").as_deref(), Some("SF Compact"));
assert_eq!(public_family(".SF Compact Rounded").as_deref(), Some("SF Compact Rounded"));
assert_eq!(public_family(".SF NS Rounded").as_deref(), Some("SF Pro Rounded"));
assert_eq!(public_family(".New York").as_deref(), Some("New York"));
assert_eq!(public_family(".Keyboard"), None);
assert_eq!(public_family("Inter").as_deref(), Some("Inter"));
}
#[test]
fn new_york_is_found_under_its_public_name() {
// macOS installs New York as `.New York` (a dot keeps it out of font menus): it used to be
// skipped, so "New York" was a missing font. Only on a Mac that has the files.
let dir = std::path::Path::new("/System/Library/Fonts");
if !dir.join("NewYork.ttf").is_file() || !dir.join("NewYorkItalic.ttf").is_file() {
return;
}
let mut pending = BTreeMap::new();
scan_dir(dir, 0, &mut pending);
let mut db = FontDb { pending, ..FontDb::default() };
let families = db.families();
assert!(families.iter().any(|f| f == "New York"), "{families:?}");
assert!(families.iter().all(|f| !f.starts_with('.')), "dot names stay out of the list: {families:?}");
for (style, italic) in [("Regular", false), ("Italic", true)] {
let face = db.find("New York", style).expect("New York loads");
assert_eq!((face.family.as_str(), face.italic), ("New York", italic), "{style}");
}
}
/// A named style keeps its own optical size whatever the text size (existing documents render as
/// before); a custom `opsz` value (what a `.sketch` import sets) wins. Needs a variable font with an
/// optical size axis and named instances: macOS's or Windows' system font.