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

Sharp breaks Fontconfig of multiple packages #2515

Closed
Glutch opened this issue Jan 4, 2021 · 3 comments
Closed

Sharp breaks Fontconfig of multiple packages #2515

Glutch opened this issue Jan 4, 2021 · 3 comments

Comments

@Glutch
Copy link

Glutch commented Jan 4, 2021

Are you using the latest version? Is the version currently in use as reported by npm ls sharp the same as the latest version as reported by npm view sharp dist-tags.latest?
Yes. 0.27.0

What are the steps to reproduce?
install either text2png or textToImage. Import sharp, suddenly text2png and / or textToImage packages custom font stops working. Since this happens to 2 different packages i assume its a problem with sharp somehow.

What is the expected behaviour?

Are you able to provide a minimal, standalone code sample, without other dependencies, that demonstrates this problem?

const fs = require('fs')
const sharp = require('sharp')
const text2png = require('text2png')

const image = text2png('texterer', {
  color: 'white',
  backgroundColor: 'black',
  lineSpacing: 10,
  padding: 20,
  font: '30px Alata',
  localFontPath: 'Alata-Regular.ttf',
  localFontName: 'Alata'
})
@Glutch Glutch added the triage label Jan 4, 2021
@lovell
Copy link
Owner

lovell commented Jan 4, 2021

If this occurs only on macOS then it probably relates to #2399

text2png is based on canvas and therefore cairo and pango, so if you want it to use CoreText for font discovery rather than fontconfig, you can set the PANGOCAIRO_BACKEND="coretext" environment variable.

@lovell
Copy link
Owner

lovell commented Jan 13, 2021

I'm planning to revert the change for #2399 as it appears to be causing too many problems.

@lovell
Copy link
Owner

lovell commented Jan 27, 2021

v0.27.1 now available

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants