Replies: 1 comment
-
I second this. Having support for some common SVG fonts would be incredible. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi all,
I'm trying to get QuestPDF to work with FontAwesome. I am running on Windows 10 Enterprise and targeting .NET 6. I have installed the FontAwesome OTF files and confirmed that they work correctly (word displays the glyphs). However, I cannot get them to work with QuestPDF.
Here is some sample code:
I would expect this to print out a location dot, however with light I get
T, regular gives me a lower case j, and bold gives me a bold lower case j.This seems to happen regardless of the chosen glyph and I get the same behavior whether copy-pasting the glyph from the FontAwesome website or using the unicode escape as demonstrated above.
I have been able to get around it by doing this, but I have to guess at the correct scale and position to make the character look right. Additionally, I have to use
Unconstrained()
to avoid an exception on build from the glyph being too big (even after scaling).Below is a screenshot of the two methods side by side (using a
.Row()
).Column 1 uses the canvas renderer (code above). Offset by 50 to center the icon since this particular glyph is narrower than the others.
Column 2 uses the text method in the first example.
Column 3 is just the letter M for comparison with standard text.
Edit: Props to #269 for showing the solution for loading an svg
Beta Was this translation helpful? Give feedback.
All reactions