Permission granted by Arsalan Shah
This is the original GoBlue Theme by OSSN but with local Google Fonts and "Font Awesome" by cloudflare.
In the GoBlue Theme provided by OSSN the Google Fonts are taken directly from the Google servers, but that is a problem in Europe, so I took the GoBlue theme and replaced the google fonts server call with local fonts in the "fonts" folder, same I did for Cloudflare stuff.
How did I archieved that?
I replaced the google fonts URL in ossn_theme.xml with a local version:
$head[] = ossn_html_css(array(
'href' => ossn_theme_url() . 'fonts/fonts.php',
));
and downloaded the fonts from google into fonts folder
I renamed the file, thanks
Just a little explanation why former version 7.6 denied to load PTSans:
As you wrote, you are starting with
$head[] = ossn_html_css(array(
'href' => ossn_theme_url() . 'fonts/fonts.php',
));
So let's have a look into libraries/ossn.lib.css.php
and see what ossn_html_css()
does ...
function ossn_html_css($args) {
if(!is_array($args)) {
return false;
}
$default = array(
'rel' => 'stylesheet',
'type' => 'text/css'
);
$args = array_merge($default, $args);
return "\r\n<link " . ossn_args($args) . " />";
}
It returns a line like
<link rel="stylesheet" type="text/css" href="https://minimickl.fritz.box/themes/goblue/fonts/fonts.php">
That's your file plus the Mime type "text/css"
added
And using the developer console we can actually find this line inside the <head>
part of our site.
Now, after switching to the Network tab doing a reload and checking fonts.php
we find the SAME text/css
being part of the REQUEST HEADER
but the RESPONSE HEADER comes up with a different Mime type of text/html
That is: Mime types differ, and that's why the browser stops further loading.
By default, all files named .php are returned as text/html by todays servers
and that's why it needed your workaround by issuing an extra header in the beginning
<?php
header("Content-type: text/css; charset=UTF-8");
?>
to 'convince' the browser it's really CSS.
The much smarter way would be simply renaming that file to fonts.css
Next release will be also with cloudflare replacement
I'd very much appreciate you would provide a COMPLETE AND WORKING release first, before adding any new features.
i was ending up adding two folders in to vendors.
vendors/fontaweson
vendors/jqueryui
And this works
Next release will be also with cloudflare replacement
got it also working
https://shadow.nlsociaal.nl/home
all local including cloudflare
Wow, yeah: PTSans are working now!
The solution is a little surprising, though. I mean:
Why requesting php to issue that header - resulting in a little more system load and extra traffic?
Why not simply providing a pure CSS file named fonts.css
as expected by the browser instead of fonts.php
?
But new issue: fontawesome is missing now.
You added
$head[] = ossn_html_css(array(
'href' => ossn_theme_url() . 'fonts/fontawesome.css',
));
but fontawesome.css is missing.
I found it
I finally found it
Will prepare the package now
I'm giving up
don't have any time or nerves to get this working at the moment...
Well marking as not working because fonts are not loading. Here you can see original theme
Your changed theme
Both fonts are different!