Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix delete font family/face when name is different from family #328

Merged
merged 1 commit into from
Apr 27, 2023

Conversation

matiasbenedetto
Copy link
Contributor

@matiasbenedetto matiasbenedetto commented Apr 17, 2023

What?

A fix for deleting font family and font faces.

Why?

When the font name is different from the font family the delete function is not working.
With this change, we look for both name and family.

How to test:

  1. Activate a theme including fonts with different name that fontFamily as Disco theme.
  2. Try to remove the font using the font manager screen and see that it is failing silently.

Example from disco:

 "fontFamilies": [
				{
					"fontFamily": "SpaceMono, serif",   <--------------------
					"name": "SpaceMono", <-----------------------------------
					"slug": "spacemono",
					"fontFace": [
						{
							"fontDisplay": "block",
							"fontFamily": "SpaceMono",
							"fontWeight": "400",
							"fontStyle": "normal",
							"fontStretch": "normal",
							"src": [
								"file:./assets/fonts/SpaceMono-Regular.ttf"
							]
						},
...

@jffng
Copy link
Contributor

jffng commented Apr 19, 2023

Can you provide an example to test this PR with?

@matiasbenedetto
Copy link
Contributor Author

Can you provide an example to test this PR with?

Yes! Sorry for not including them earlier. I updated the PR description with test instructions.

Copy link
Contributor

@jffng jffng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works as advertised!

@matiasbenedetto matiasbenedetto merged commit c06ddb2 into trunk Apr 27, 2023
@vcanales vcanales deleted the fix/font-family-delete branch May 23, 2024 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants