Sat Nov 17 2012 22:09:38 GMT+0400 (Caucasus Standard Time) пользователь Krinkle
([email protected]) написал:
On Nov 17, 2012, at 6:08 PM, Dmitriy Sintsov <[email protected]> wrote:
> Right. I can probably make local stylesheet with references to google cdn,
however I am not sure it wil not violate IE security or something.
> So I did:
> $out->addLink( array( "rel" => "stylesheet", "href" =>
"http://fonts.googleapis.com/css?family=PT+Sans+Narrow&subset=latin,cyrillic,latin-ext"
> ) );
> $out->addLink( array( "rel" => "stylesheet", "href" =>
"http://fonts.googleapis.com/css?family=Open+Sans:400,600&subset=latin,cyrillic,latin-e
> xt,cyrillic-ext,greek,greek-ext" ) );
>
No IE security issues, unless your website is served from HTTPS in which
Chrome, IE and possibly other browsers will block those requests (which is
good).
The Google Font APIs support HTTPS natively:
*
http://fonts.googleapis.com/css?family=PT+Sans+Narrow&subset=latin,cyrillic,latin-ext
*
https://fonts.googleapis.com/css?family=PT+Sans+Narrow&subset=latin,cyrillic,latin-ext
So in that case I'd recommend load with with a protocol-relative url so that it
always works (only do this for urls that you know support both, such as Google
Font APIs).
"href" =>
"//fonts.googleapis.com/css?family=PT+Sans+Narrow&subset=latin,cyrillic,latin-ext"
More about protocol-relative:
http://paulirish.com/2010/the-protocol-relative-url/
-- Krinkle
I know that MW uses (not widely-known) protocol-relative URL's since 1.18.
You're right that link has to be corrected. it wil point to two different
stylesheets,
depending on site protocol used:
http://fonts.googleapis.com/css?family=PT+Sans+Narrow&subset=latin,cyrillic,latin-ext
https://fonts.googleapis.com/css?family=PT+Sans+Narrow&subset=latin,cyrillic,latin-ext
Dmitriy
_______________________________________________
Wikitech-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l