ZIm/crates/ui/src
Marshall Bowers 0329b4a5cb
Allow loading "Segoe Fluent Icons" font on macOS (#9421)
This PR updates the `TextSystem` on macOS to allow loading the "Segoe
Fluent Icons" font.

We're using this font in the Storybook to render the `TitleBar` as it
would appear on Windows despite us running it on macOS. This is to make
things easier for iterating on UI design without needing to test on each
individual platform.

However, the "Segoe Fluent Icons" font does not have a glyph for the `m`
character, causing it to run afoul of a precautionary check added in
#4029, which ultimately results in the font not being loaded (and thus
rendering as a missing glyph).

We work around this by simply ignoring this check if the font we're
trying to load is specifically "Segoe Fluent Icons".

I think longer-term we'll need to revisit the behavior in the editor
that is causing the panics when the `m` glyph is missing from the font,
but that's a problem for a different day.

#### Before

<img width="1283" alt="Screenshot 2024-03-15 at 3 34 38 PM"
src="https://github.com/zed-industries/zed/assets/1486634/c0ddd46d-8599-4729-ac98-75522b33e25b">

#### After

<img width="1113" alt="Screenshot 2024-03-15 at 5 12 36 PM"
src="https://github.com/zed-industries/zed/assets/1486634/183c2b43-5e4f-4516-8856-7a2d45ed8b2e">

Note that you currently need to install the "Segoe Fluent Icons" font
yourself—either installing it globally or placing the `.ttf` file in the
`assets/fonts` directory—in order to see the icons rendered. I'd like to
look into getting this, but there are restrictions on the distribution
of the font on non-Windows platforms that will need to be followed.

Release Notes:

- N/A
2024-03-15 17:35:10 -04:00
..
components Allow loading "Segoe Fluent Icons" font on macOS (#9421) 2024-03-15 17:35:10 -04:00
styles ui: Refine TitleBar component (#9415) 2024-03-15 15:48:07 -04:00
utils ui: Fix doc tests (#3989) 2024-01-09 16:56:28 -05:00
clickable.rs Document ui crate traits 2024-01-09 14:15:25 -05:00
components.rs ui: Refine TitleBar component (#9415) 2024-03-15 15:48:07 -04:00
disableable.rs Fix possessive "its" in docs and comments (#3998) 2024-01-10 10:09:48 -05:00
fixed.rs Document ui crate traits 2024-01-09 14:15:25 -05:00
prelude.rs ui: Refine TitleBar component (#9415) 2024-03-15 15:48:07 -04:00
selectable.rs Clean up references in doc comments in ui and theme crates (#3985) 2024-01-09 15:22:36 -05:00
styled_ext.rs Fix flickering (#9012) 2024-03-11 10:45:57 +01:00
styles.rs ui: Refine TitleBar component (#9415) 2024-03-15 15:48:07 -04:00
ui.rs Document UI modules 2024-01-09 12:57:12 -05:00
utils.rs Document UI modules 2024-01-09 12:57:12 -05:00
visible_on_hover.rs Remove 2 suffix for ui, storybook, text 2024-01-03 12:33:51 -08:00