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

Add more generic font families to FabricText.genericFonts #10167

Merged
merged 1 commit into from
Oct 2, 2024

Conversation

elohmeier
Copy link
Contributor

@elohmeier elohmeier commented Sep 20, 2024

Copy link

codesandbox bot commented Sep 20, 2024

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

@asturur
Copy link
Member

asturur commented Sep 24, 2024

Hi @elohmeier is this fixing some kind of issue you where having? can you elaborate a bit more?

@elohmeier
Copy link
Contributor Author

Yes, since the font declaration will encapsulate the font name without this change in quotes ("system-ui" instead of system-ui), this leads failing font resolution, at least in Firefox on macOS.

Before the change:
CleanShot 2024-09-25 at 05 21 49
normal 600 16px "system-ui"

After the change:
CleanShot 2024-09-25 at 05 22 13
normal 600 16px system-ui

See also https://developer.mozilla.org/en-US/docs/Web/CSS/font-family#generic-name. We should probably add all the other generic font names as well.

I'm currently monkey-patching this using fabric.FabricText.genericFonts.push("system-ui"); after importing fabric.

@asturur
Copy link
Member

asturur commented Sep 26, 2024

Yes please add all generic names, if they have to be 'not quoted' as the specs say, we should have that working.

@asturur
Copy link
Member

asturur commented Sep 26, 2024

Also add a changelog line please

@elohmeier elohmeier changed the title Add system-ui to FabricText.genericFonts Add more generic font families to FabricText.genericFonts Oct 2, 2024
@elohmeier
Copy link
Contributor Author

Thanks for your feedback, I've updated the PR accordingly.

@asturur asturur merged commit 9a7a1d3 into fabricjs:master Oct 2, 2024
20 of 24 checks passed
@elohmeier elohmeier deleted the system-ui-font branch October 2, 2024 12:38
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