font-manager icon indicating copy to clipboard operation
font-manager copied to clipboard

check for document before appending stylesheet

Open magicspon opened this issue 2 years ago • 4 comments

closes #4

magicspon avatar Mar 09 '22 16:03 magicspon

It still needs to be initialised when the window/document is available.

function useFontManager(
	apiKey: string,
	props: Partial<Props>,
	options: Options,
) {
	const [fontManager, setFontManager] = React.useState<FontManager>()

	React.useEffect(() => {
		if (typeof window !== 'undefined') {
			setFontManager(
				new FontManager(
					apiKey,
					props.activeFontFamily,
					options,
					props.onChange,
				),
			)
		}
	}, [])

	return fontManager
}

magicspon avatar Mar 09 '22 17:03 magicspon

sadly the whole project seems dead. thanks to @samuelmeuli for delivering this, but I would not use it as unmaintained,

ghost avatar Mar 12 '22 08:03 ghost

@bacloud22 do you know of any alternatives.

magicspon avatar Mar 24 '22 14:03 magicspon

Nope, unfortunately. Good luck

ghost avatar Mar 24 '22 14:03 ghost