Skip to content

How to removed font families onload #34

Open
@shinokada

Description

@shinokada

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)
	});			
    }
);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions