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

Fonts not getting exported in the img ? #90

Open
flazouh opened this issue May 14, 2024 · 1 comment
Open

Fonts not getting exported in the img ? #90

flazouh opened this issue May 14, 2024 · 1 comment

Comments

@flazouh
Copy link

flazouh commented May 14, 2024

Hello,

I've encountered an issue with the "modern-screenshot" tool where the font does not render as expected when exporting an image. Below are the details of the issue:

Description:
When using the domToJpeg method to export an image of a videoContainerElement, the resulting image does not display the text in the correct font. Instead of the expected font, the text appears in a default or fallback font. This issue occurs when exporting the image with a scale factor of 3.

Steps to Reproduce:

  1. Navigate to a page.
  2. Trigger the domToJpeg function with the following configuration:
    dataURL = await domToJpeg(element, {
      scale: 3,
    });
  3. Observe the exported image and compare the font style to the expected one.

Expected Behavior:
The text in the exported image should match the font style used in the element.

Actual Behavior:
The text in the exported image defaults to a different font, ignoring the specified font style in the element.

Screenshots:

  • Expected font rendering: Expected Font
  • Actual font rendering in the exported image: Actual Font

Environment:

  • OS: [Your Operating System]
  • Browser: [Your Browser]
  • Version of modern-screenshot: [The version you are using]

I've tried to look into the options and saw some css and fonts options but i'm not sure if those are the one I need. Is there a known workaround or fix for this issue?

Thank you for your assistance.

@lzlife
Copy link

lzlife commented Jun 17, 2024

Did you solve it?

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

No branches or pull requests

2 participants