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 list of fonts excluded from having previews generated. #20

Merged
merged 2 commits into from
Feb 29, 2024

Conversation

pbking
Copy link
Collaborator

@pbking pbking commented Feb 6, 2024

Also added ability to render a single font family preview via command line.

node src/generate_font_previews.js font-family-slug

Also added a collection of font faces that have poorly generated previews. (See #18)

Those fonts will render in the UI instead of depending on the previews.

Better would be to determine why the previews aren't being generated correctly. Until/unless that happens this might be an acceptable band-aid.

…ity to render a single font family preview via command line.
@matiasbenedetto
Copy link
Collaborator

matiasbenedetto commented Feb 6, 2024

I haven't try this PR yet, but I'm curious how those fonts render without a preview image.
Does not adding a preview solve the problem?

@pbking
Copy link
Collaborator Author

pbking commented Feb 6, 2024

I'm curious how those fonts render without a preview image.
Does not adding a preview solve the problem?

Yes, the (few) fonts that don't have a preview URL load the fonts for the Font Library UI.

Before:
image

After:
image

It's unclear to me why these fonts don't generate a preview as expected, yet render fine in a browser. However this does allow them to render as expected.

@ironprogrammer
Copy link

Thank you for digging into this, @pbking!

For problematic fonts without glyphs to support printing existing previews, could the exclusion list include an [optional?] alternate string of existing glyphs to use instead?

E.g. for Chenla, something like ឈិនឡា (Google Translate says that's "Chenla" in Khmer). Perhaps online search and the polyglots community can help identify good strings to use for this relatively short list.

And if there are remaining fonts with missing default glyphs that don't spell anything, then this string could be used to exhibit a sample of glyphs a user would have access to.

@mikachan
Copy link
Member

For problematic fonts without glyphs to support printing existing previews, could the exclusion list include an [optional?] alternate string of existing glyphs to use instead?

I think this is a great idea, although I think it would be best to implement this in a follow-up. That means we could land this PR sooner to fix the broken font previews for 6.5.

@pbking @matiasbenedetto What do you think?

@pbking
Copy link
Collaborator Author

pbking commented Feb 29, 2024

I believe it might be a valid follow up. It might be relevant to just provide custom SVGs for certain font families/faces too rather than generate those. The list is likely small and the work involved maybe not worthwhile for such a few exceptions.

This change fixes the issue at hand. I rather thing it should come in as a fix for now. If we want to get fancier then let's document and fix that sometime down the road.

Copy link
Member

@mikachan mikachan left a comment

Choose a reason for hiding this comment

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

This change fixes the issue at hand. I rather thing it should come in as a fix for now. If we want to get fancier then let's document and fix that sometime down the road.

Makes sense, let's bring this in 👍

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.

Some SVG image previews are clipped or not rendered legibly in GB 17.6
4 participants