Open t-hamano opened 6 months ago
After further investigation, I think there is a difference in the logic that generates the preview text and preview image.
Preview text: Generated in gutenberg.
Preview image: Generated by a script in the google-fonts-to-wordpress-collection
repository
const text = isAFamilyPreview
? family.name
: `${ family.name } ${ face.fontWeight } ${ face.fontStyle }`;
I have also filed an issue in the google-fonts-to-wordpress-collection
repository: https://github.com/WordPress/google-fonts-to-wordpress-collection/issues/23
Description
When accessing the "Install Fonts" tab of the font library and accessing a font with variations, the preview image does not appear to be displayed correctly.
Below is a screenshot when accessing the "Afacad" font. Note that the format of the displayed preview is
{FontName} {FontWeightNumber} {FontStyleName}
.Below is the font selected in the Library tab after it has been installed:
On the other hand, if you download this font from Google Fonts and upload all variations from the Upload tab, you will see something like this. Note that the format of the displayed preview is
{FontName} {FontWeightName} ({FontStyleName})
.I feel uncomfortable with this discrepancy.
My understanding is that if we access Google Fonts from the Install Fonts tab, the preview you see is an SVG image rather than the actual text, and it is hosted on an external server. I am concerned that the file name and SVG image for this image may not be generated correctly.
Step-by-step reproduction instructions
Screenshots, screen recording, code snippet
No response
Environment info
No response
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes