Custom Fonts: notify user about deleted fonts in story
See original GitHub issueFeature Description
It’s possible for custom fonts (and even Google Fonts!) to be deleted.
When the user opens a story that uses a font that no longer exists, we want to notify the user about it.
Here’s what this notification should be like:
Figma: View current design
Screenshot:
General flow:
- When opening a story in the editor, we go through all text elements in a story and their fonts
- For each font, we try to retrieve information about it from the server. If the server doesn’t return the font information, we know it has been deleted.
- For each missing font, display a single modal to let the user know about it, offering further instructions.
- That means in the unlikely event of there being multiple missing fonts, there will be multiple modals, one after the other
- The modal displays the single
<FontPicker>
dropdown; the same component we use in the design panel.
CTAs
- “Open anyway” will close the modal & replace the missing font for all affected elements with Roboto (either from
TEXT_ELEMENT_DEFAULT_FONT
or fetched via API) - “Replace font” will close the modal & replace the missing font for all affected elements with the selected font from the picker
When replacing an element’s missing font, the font weight should be preserved. If the replacement font is not available in the same weight, we pick the closest possible match
Implementation notes:
FontPicker
needs to be refactored so thathandleFontPickerChange
andfontFamily
are passed via props instead (so there is no dependency onselectedElements
andpushUpdate
- We might want to add
font
toELEMENT_PROPS_TO_IGNORE
, so that clicking on “Open anyway” does not cause a history entry - The rough flow is similar to how
<StatusCheck>
works - Can add JS & e2e tests for this
- Can add storybook story for this dialog as well
Alternatives Considered
Additional Context
- While we’re at it, if there are saved templates that use a missing font, should we also notify the user in this case?
- If a font still exists but has updated metrics, we could simply update the metrics for all affected elements silently. (requires updating
ELEMENT_PROPS_TO_IGNORE
accordingly)
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
9 Little-Known Font How-Tos for Instagram Stories
1. Add your brand font to the Stories. Recently, Instagram released new fonts for Stories for us all to play with. It's true:...
Read more >How To Add Custom Fonts To Your Instagram Story
Step up your social media game and get creative with this step-by-step guide for how to add custom fonts to your Instagram Story....
Read more >Custom Fonts and Audio - WordPress.org
Are you looking for a way to use custom fonts that are not available on Google Fonts?
Read more >How to Add Custom Fonts to Instagram Stories - Bad Rhino Inc.
To use this app: Open the app and upload the photo you want to post to you story. Tap the “add text” option...
Read more >Common Mistakes With Adding Custom Fonts to Your iOS App
Step 1: Include your fonts in your XCode project. Most commonly, you'll have a TTF or OTF font that you'll want to use...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Tested against https://stories-qa-wordpress-amp.pantheonsite.io/wp-admin/, using PR #10808.
https://user-images.githubusercontent.com/96055551/158597504-87b14edc-92c8-44d7-a827-eae66428b10b.mp4
@timarney The font picker uses the
Datalist
component from the design system. TheDatalist
component has azIndex
prop for overriding the popup’s default z-index (which I think is2
).