fonts.googleapis

85 views
Skip to first unread message

T.R.Rajkumar

unread,
Dec 8, 2017, 5:06:35 AM12/8/17
to web2py-users
I have an application. The views extend layout.html. When there is no internet connection my pages wait for fonts.googleapis.com
I dont want that to happen. How to remove the dependecy on fonts.gooleapis.com

T.R.Rajkumar

unread,
Dec 8, 2017, 5:07:28 AM12/8/17
to web2py-users
Its an intranet application.

黄祥

unread,
Dec 8, 2017, 6:12:21 AM12/8/17
to web2py-users
i think you can download it (*.ttf, *.woff, *.woff2, etc) and change the url (font.googleapis.com) into your downloaded path in your css

best regards,
stifan

Alex Beskopilny

unread,
Dec 8, 2017, 6:34:32 PM12/8/17
to web2py-users


On Friday, December 8, 2017 at 1:06:35 PM UTC+3, T.R.Rajkumar wrote:
I have an application. The views extend layout.html. When there is no internet connection my pages wait for fonts.googleapis.com
I dont want that to happen. How to remove the dependecy on fonts.gooleapis.com
hI!
1  get downloader  (google-font-download  - bash script)
git clone https://github.com/neverpanic/google-font-download
2 view fonts in /home/w2p/web2py/applications/myapp/static/css/bootstrap.min.css
3 mkdir /home/w2p/mygoogfont
   cd /home/w2p/mygoogfont
   get fonts (with your locale ! mylocale - cyrillic)
./google-font-download  "Open Sans:300" "Open Sans:400" "Open Sans:700" "Open Sans:300italic" "Open Sans:400italic"  "Open Sans:700italic" -lcyrillic,latin
4  cp font.css   /home/w2p/web2py/applications/myapp/static/css
and change import string in bootstrap.min.css   @import url("font.css");
5  add to nginx
location ~* ^/(.*)\/static\/css\/(.*)\.(woff|eot|ttf|woff2)$ {
    alias /home/w2p/mygoogfont/$2.$3;
    #https://www.regexpal.com/93773
    add_header Pragma public;
    add_header Access-Control-Allow-Origin "*";
    expires 30d;
}

T.R.Rajkumar

unread,
Dec 13, 2017, 4:33:02 AM12/13/17
to web2py-users
Thank you Alex. I removed the @import in bootstrap.min.css I do not want that.


On Friday, December 8, 2017 at 3:36:35 PM UTC+5:30, T.R.Rajkumar wrote:

Alex Beskopilny

unread,
Dec 14, 2017, 2:02:35 AM12/14/17
to web2py-users


On Friday, December 8, 2017 at 1:06:35 PM UTC+3, T.R.Rajkumar wrote:
I have an application. The views extend layout.html. When there is no internet connection my pages wait for fonts.googleapis.com
I dont want that to happen. How to remove the dependecy on fonts.gooleapis.com

small fix. added google-svg-font
5+  add to nginx
location ~* ^/(.*)\/static\/css\/(.*)\.(woff|eot|ttf|svg|woff2)$ {
    alias /home/w2p/gofont/$2.$3;

    #https://www.regexpal.com/93773
    add_header Pragma public;
    add_header Access-Control-Allow-Origin "*";
    expires max;
    #expires 30d;
}

Reply all
Reply to author
Forward
0 new messages