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

Custom Font not working #123

Closed
fateenarinah opened this issue Jul 5, 2024 · 1 comment
Closed

Custom Font not working #123

fateenarinah opened this issue Jul 5, 2024 · 1 comment

Comments

@fateenarinah
Copy link

fateenarinah commented Jul 5, 2024

Hi! I'm encountering an issue with an SVG image that uses the Open Sans font family. When I upload it into Dompdf, the font family gets changed to something else. I've already tried setting the SVG code to use the Open Sans font family, but it's not working. I'd greatly appreciate it if someone could guide me on how to properly utilize the Open Sans font family in my SVG code.

Below is the SVG code I'm currently using.

Screenshot 2024-07-05 121805

and the output
Screenshot 2024-07-05 121934

I've examined the SVG code using the SVG Viewer and have attached the output below. It appears to be functioning properly there, but when I transfer it to Dompdf, an issue similar to the one shown in the first screenshot arises.

Screenshot 2024-07-05 121958

@bsweeney
Copy link
Member

bsweeney commented Jul 5, 2024

SvgLib does not yet have font management logic. Because of this you have to specify the path to the font file instead of the font name, unless you're using a core PDF font such as helvetica or a generic font family such as sans-serif. See #110 for details and updates on improved font selection support.

I see you also have a tspan in there, which is also not yet supported. Follow #64 for updates on that feature.

@bsweeney bsweeney closed this as completed Jul 5, 2024
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