Skip to content

Some fonts render with the wrong font face #39

@schester44

Description

@schester44

Its hit or miss but it seems like fonts that are more "stylish" or complex are the ones that don't render correctly. A group of fonts within the same family will all render using, what appears to be, the exact same font.

This is occurring on OSX and Freebsd.

Example fonts:
https://drive.google.com/drive/folders/1tBD2RnuEpLHofEdS4Eeg7VvSgk6nt7S1?usp=sharing

The code i'm using:

import text2png from 'text2png'
import fontkit from 'fontkit'

const textToImage = ({ text, file }) => {
	const name = text || fontkit.openSync(file).fullName

	return text2png(name, {
		padding: 10,
		font: `20px ${name}`,
		localFontPath: file,
		localFontName: name
	})
}

export default textToImage

I'll continue my research upstream but wanted to drop an issue on this project in case someone has some info related to this.

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