GoBlue Theme (Local Fonts) Download 7.9

German Dominik L 2 weeks ago

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

Comments
German Dominik L Replied 1 week ago

I renamed the file, thanks

German Michael Zülsdorff Replied 1 week ago

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

enter image description here

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

German Michael Zülsdorff Replied 1 week ago

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.

Dutch Eric redegeld Replied 1 week ago

i was ending up adding two folders in to vendors.
vendors/fontaweson
vendors/jqueryui
And this works

German Dominik L Replied 1 week ago

Next release will be also with cloudflare replacement

Dutch Eric redegeld Replied 1 week ago

got it also working
https://shadow.nlsociaal.nl/home
all local including cloudflare

German Michael Zülsdorff Replied 1 week ago

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.

German Dominik L Replied 1 week ago

I found it

I finally found it

Will prepare the package now

enter image description here

German Dominik L Replied 1 week ago

I'm giving up

don't have any time or nerves to get this working at the moment...

Indonesian Arsalan Shah Replied 1 week ago

Well marking as not working because fonts are not loading. Here you can see original theme

enter image description here

Your changed theme

enter image description here

Both fonts are different!

Component

Developer: Dominik
License ossnv4
Type: Themes
Requires Ossn Version : 7.3
Latest Version: 7.9
Last Updated 1 week ago
Repository Url View Repository

Versions