Comments (6)
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.
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.
@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.
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.
Great to here @Loots-it.
Feel free to send in a PR.
from sidecar-browsershot.
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)
- encoding differs HOT 5
- Emoji CDN sometimes return 429 HOT 7
- Invoke Error 429 HOT 3
- file_put_contents(/var/task/vendor/wnx/sidecar-browsershot/src/Functions/../../resources/lambda/NotoColorEmoji.ttf): Failed to open stream: Read-only file system HOT 3
- Loading never stop HOT 1
- file_get_contents(/var/task/vendor/spatie/browsershot/bin/browser.js): Failed to open stream: No such file or directory HOT 2
- Deprecated Node Runtime HOT 5
- Function `browsershot` not found in environment `staging` HOT 1
- Generated pdf contains [object Object] HOT 3
- sidecar-deployment-user is not authorized to perform: lambda:GetLayerVersion in me-south-1 HOT 1
- TargetCloseError: Protocol error (Page.printToPDF): Target closed HOT 9
- Corrupted PDF on production, fine on local HOT 11
- Lambda execution randomly times out HOT 7
- Unable to install using Laravel 11 HOT 2
- For some reason Chrome did not write a file at `example.pdf` HOT 1
- Error: Navigating frame was detached at #onFrameDetached HOT 3
- Error: Navigating frame was detached HOT 3
- Times out when creating screenshots HOT 2
- Add sidecar v0.6 to the list of allowed versions (right now it just has 4 and 5). HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sidecar-browsershot.