Posts:
7
Registered:
25-May-2017
|
|
|
|
Copy Google Fonts does not work
Posted:
8 Sep 22, 20:52
|
|
|
|
I have selected "Copy Google Fonts" but now no references to the fonts are created into the generated HTML code.
I have tried to find the reason. In page-header.inc this if statements fails:
if ((copyGoogleFonts === UNDEF || copyGoogleFonts) && typeof googleFontFaces !== UNDEF && !!googleFontFaces) {
copyGoogleFonts is set to true but googleFontFaces is empty (typeof returns String).
jAlbum version is 28.1.5
|
|
|
Posts:
8,095
Registered:
31-Jan-2006
|
|
|
|
Re: Copy Google Fonts does not work
Posted:
8 Sep 22, 21:43
in response to: martinherbst
|
|
|
I just tried a simple test album with the Copy Google fonts option, and it works just fine. When the skin copies the font to the album, it's no longer a call to the Google site (which is precisely the point). It's added to the album as a WOFF file. Here's the line from the index.html of my test album: <link rel="preload" href="res/fonts/daaCSScvJGqLYhG8nNt8KPPswUAPni7TTMw.woff2" as="font" type="font/woff2" crossorigin>
And the CSS is similarly modified: /* Google Fonts */
/* latin */
@font-face {
font-family: 'Cinzel Decorative';
font-style: normal;
font-weight: 400;
font-display: swap;
src: url(fonts/daaCSScvJGqLYhG8nNt8KPPswUAPni7TTMw.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
|
|
|
Posts:
8,095
Registered:
31-Jan-2006
|
|
|
|
Re: Copy Google Fonts does not work
Posted:
8 Sep 22, 21:45
in response to: JeffTucker
|
|
|
|
BTW, for testing, choose one of the more obvious Google fonts for the headline, like Cinzel Decorative. That way, you can tell instantly whether it's working or not!
|
|
|
Posts:
1,627
Registered:
6-Sep-2005
|
|
|
|
Re: Copy Google Fonts does not work
Posted:
9 Sep 22, 08:20
in response to: martinherbst
|
|
|
|
The copyGoogleFonts returns the font list copied to the local album. If you are offline or Google Fonts is inaccessible the string will be empty.
|
|
|
Posts:
7
Registered:
25-May-2017
|
|
|
|
Re: Copy Google Fonts does not work
Posted:
9 Sep 22, 18:53
in response to: Laza
|
|
|
|
Thanks for your quick replies.
I have updated the skin to the latest version, but nothing changed. No fonts are downloaded to the res folder, and there is no @font-face entry added to common.css.
For the browser Google Fonts is accessible. If I don't select "Copy Google Fonts" the fonts are displayed correctly.
I have tried it with a fresh album but with same result.
I am running jAlbum on Windows 11 with Java 14 that is embedded into jAlbum.
|
|
|
Posts:
8,095
Registered:
31-Jan-2006
|
|
|
|
Re: Copy Google Fonts does not work
Posted:
9 Sep 22, 19:34
in response to: martinherbst
|
|
|
|
Do you have any third-party "security" software on your PC? It may be blocking access.
|
|
|
Posts:
7
Registered:
25-May-2017
|
|
|
|
Re: Copy Google Fonts does not work
Posted:
9 Sep 22, 19:54
in response to: JeffTucker
|
|
|
|
Nothing special. Only Microsoft Defender. I don't have any problems with accessing Google Fonts directly from Google. If I don't set "Copy Fonts" and open the generated HTML locally in the browser, the fonts are downloaded.
I can try to use Wireshark to see what's happening.
|
|
|
Posts:
8,095
Registered:
31-Jan-2006
|
|
|
|
Re: Copy Google Fonts does not work
Posted:
9 Sep 22, 20:02
in response to: martinherbst
|
|
|
|
Also please look at the jAlbum console - F7 - to see if there are any error messages.
|
|
|
Posts:
7
Registered:
25-May-2017
|
|
|
|
Re: Copy Google Fonts does not work
Posted:
9 Sep 22, 20:18
in response to: JeffTucker
|
|
|
Good to know the reason  .
For me it is not a problem to wait for the next jAlbum release. I have already modified the skin to use local copy of the fonts. But I would be happy to get rid of my modifications.
|
|
|
Posts:
8,095
Registered:
31-Jan-2006
|
|
|
Posts:
7
Registered:
25-May-2017
|
|
|
|
Re: Copy Google Fonts does not work
Posted:
9 Sep 22, 20:31
in response to: JeffTucker
|
|
|
Good idea. Will try it tomorrow  .
Thanks for the link. Did not know that I could get it from the forum.
Edited by: martinherbst on 9 Sep 2022, 20:40
|
|
|
Posts:
1,627
Registered:
6-Sep-2005
|
|
|
|
Re: Copy Google Fonts does not work
Posted:
10 Sep 22, 08:35
in response to: JeffTucker
|
|
|
|
|
That's really odd. For me, all versions work: 24.1, 28.1, and the beta. Although in 24.1 it writes out
WARNING: Couldn't fetch the fonts from Google. You are probably offline.
to the console, but it copies the fonts. The other versions work without a warning. I have recompiled it to Java 14, and the result is the same. (Attached is the new jar file)
When I printed out the cause of the error, jAlbum said:
java.lang.ClassCastException: Cannot cast jdk.nashorn.internal.runtime.Undefined to javax.net.ssl.SSLSocketFactory
I guess it's about permission issues, and this could explain why you see different results on Mac. It's odd, but using http: instead of https: accessing the css file doesn't change the behavior.
|
|
|
Posts:
8,095
Registered:
31-Jan-2006
|
|
|
|
Re: Copy Google Fonts does not work
Posted:
10 Sep 22, 12:33
in response to: Laza
|
|
|
With the replaced files, in jAlbum 27.0.7 on Windows, the routine still fails, with these errors: WARNING: Couldn't fetch the fonts from Google. You are probably offline. Please connect to the internet or turn off "Copy Google fonts"!
java.lang.ClassCastException: Cannot cast jdk.nashorn.internal.runtime.Undefined to javax.net.ssl.SSLSocketFactory
I get exactly the same errors in jAlbum 28.1.5 on macOS.
Without the replaced files, I get the "Couldn't fetch..." message on both platforms, but not the "Cannot cast..." message.
|
|
|
Posts:
8,095
Registered:
31-Jan-2006
|
|
|
|
Re: Copy Google Fonts does not work
Posted:
10 Sep 22, 12:40
in response to: JeffTucker
|
|
|
|
The latest release of Tiger produces the same failure and error message in older versions of jAlbum.
Instead of continuing to wrestle with this, perhaps the skin updates should be put on "hold" until jAlbum 28.2 is released. Forget about backward compatibility - It's not unreasonable for bundled skins to require the latest version of the core application.
|
|
|
|
Legend
|
|
Forum admins
|
|
Helpful Answer
|
|
Correct Answer
|
|