Giter VIP home page Giter VIP logo

Comments (6)

stefanzweifel avatar stefanzweifel commented on August 10, 2024

If you don't declare the font family that should be used in your $html, then the default system font stack of the underlying operating system will be used.

Haven't checked the source of spatie/browsershot, but I'm sure that they don't declare a default font or include fonts by default. That would feel weird.

Weirdly I can't reproduce this error in screeenly, my side project that uses thie package under the hood. This playground generates PDFs that don't use a serif-font if no font-family is declared.
(The project uses the latest version of this package 🤔)


I'm hesitant to fix as it feels like a niche problem; but feel free to explore how to fix this bug.
I can't promise that I will merge a PR though, if it puts a high maintenance burden on to me.

from sidecar-browsershot.

Loots-it avatar Loots-it commented on August 10, 2024

But the given font-family does not seem to work? This playground gives me exactly the same font even if I set the font-family. Or maybe it's dependent on the aws regio, I'm not sure if screeenly uses the closest region? I'm using the frankfurt region for my own project. Maybe there is a bug in that specific layer?

from sidecar-browsershot.

stefanzweifel avatar stefanzweifel commented on August 10, 2024

@Loots-it Yeah, something is definitely off here.
screeenly is also hosted in eu-central-1, but I noticed that an older version of the Lambda function is still around and somehow get's traffic. Might be a config-error on my side.

Have to be honest here: no idea which fonts are available on AWS Lambda by default. Weird that font-family in the example doesn't seem to have an impact at all. 🤔

from sidecar-browsershot.

Loots-it avatar Loots-it commented on August 10, 2024

I did some experiments and it's quite easy to add a new font. It makes sense that we don't know which fonts are available on AWS Lambda. The idea is that it's serverless, so we shouldn't depend on any defaults (in my opinion).

I feel like it would be a big benefit to add some default font families to sidecar-browsershot and provide the possibility for users to add more custom fonts. I don't think the development is that much work so the maintenance burden shouldn't be too high. Do you think that this might be worth it? If so, I will start on a PR.

from sidecar-browsershot.

stefanzweifel avatar stefanzweifel commented on August 10, 2024

Great to here @Loots-it.
Feel free to send in a PR.

from sidecar-browsershot.

stefanzweifel avatar stefanzweifel commented on August 10, 2024

Support for custom fonts has been implemented in #101.
A new version has been released: https://github.com/stefanzweifel/sidecar-browsershot/releases/tag/v1.13.0

from sidecar-browsershot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.