Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to removed font families onload #34

Open
shinokada opened this issue Jan 17, 2022 · 0 comments
Open

How to removed font families onload #34

shinokada opened this issue Jan 17, 2022 · 0 comments

Comments

@shinokada
Copy link

shinokada commented Jan 17, 2022

I'm trying to remove a bunch of font families, Hind Siliguri, Hind Madurai, Mukta, Noto Sans HK, Noto Sans JP, and more.

Are there any examples I can remove them onload?

I can use removeFont onChange, but not onload.

Also adding the removeFont method to the onChange callback, it fires errors when I select a font since it is already removed.

image

const fontPicker = new FontPicker(
	"My-API-Key", // Google API key
	"Open Sans", // Default font
	{ limit: 100 }, // Additional options
	()=>{
	    const fontsToRemove =['Hind Siliguri', 'Hind Madurai','Mukta','Noto Sans HK','Noto Sans JP','Noto Sans KR','Noto Sans SC','Noto Sans TC','Noto Serif JP','Assistant','Mulish','Padauk', 'Cormorant Garamond']
	    fontsToRemove.forEach(font => {
	    fontPicker.removeFont(font)
	});			
    }
);
@shinokada shinokada changed the title How to removed font families using removeFont How to removed font families onload Jan 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant