Giter VIP home page Giter VIP logo

embed-google-fonts's Issues

CSS for modern browser

Hey,

we got problems with the .eot files of an font. This file seems to be corrupt on google servers. As we are using only woff/woff2 files right now, i wondered if we could add the option to only use the modern browser version that the heroku app offers?

This should be as easy as adding &formats=woff,woff2 as URI parameters. Unfortunately I don't know how to add a setting otherwise I would have opened a Pull-request :D.

Btw. can I just change the _font.css after copying the fons locally or will it get overwritten at some point?

Thank you for this nice plugin!

Font strong is not embedded

Hi,

thanks for your well thought-out plugin!
I downloaded the font I use (Barlow), but it doesn't include the strong subset, grade 500 or 600. How can I add that? Thank you!

Issues with URLs of some embedded fonts returning 404

Hi there,
thanks for this useful plugin. I have found a bug when using the Kanit font with the following enqueue:

wp_enqueue_style( 'google-font', 'https://fonts.googleapis.com/css?family=Kanit:100,200,300,400,400,500,700,900&display=swap' );

Basically, there was a mismatch between the file name in the local cache and the URL used as a replacement in the link.

I.e. The file was named kanit-v13-latin_latin-ext_thai_vietnamese-100.woff but the URL was kanit-v12-vietnamese_latin-ext_latin-regular.woff2, resulting in several 404 errors.

There were two different issues:

  1. The "thai" subset was completely missing
  2. It seems the order of the subsets in the two cases was not corresponding.

I was able to fix the issue with the following snippet thanks to the available filter:

// Fix to embed Kanit font via Embed Google Fonts plugin.
function bs_fix_embed_google_fonts_get_subsets( $subsets ) {
	if ( ! in_array ( 'thai', $subsets ) ) {
		$subsets[] = 'thai';
	}
	sort( $subsets );
	return $subsets;
}
add_filter( 'embed_google_fonts_get_subsets', 'bs_fix_embed_google_fonts_get_subsets' );

However, it would be ideal to add 'thai' and reorder the subsets directly in the original plugin.
Thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.