Visual differance in PDF and SVG exported Text

Discussions about the development of the TechDraw workbench
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
tobiasfalk
Posts: 93
Joined: Fri Feb 05, 2021 2:35 pm

Visual differance in PDF and SVG exported Text

Post by tobiasfalk »

I spoted a difference with the Text betwen the PDF export and the SVG export, this may be related to the fact that the PDF Text is not "Text"(viewtopic.php?t=69791) but it is a simple visual differance:
One can see a clear difference in the line thignes of the text and the spacing between the charecters(look at the bottom line), I used the "A4_LandscapeTD.svg" template for the test.
The PDF export:
FreeeCAD_Exported_PDF.png
FreeeCAD_Exported_PDF.png (104.59 KiB) Viewed 1673 times
The SVG Export and then converted to PDF with Inkscape:
FreeeCAD_Exported_SVG_u_Inks_tp_PDF.png
FreeeCAD_Exported_SVG_u_Inks_tp_PDF.png (204.86 KiB) Viewed 1673 times
The Template opend in Microsoft Edge:
FreeeCAD_Template_in_Edge.png
FreeeCAD_Template_in_Edge.png (156.79 KiB) Viewed 1673 times
In FreeCAD it self:
In_FreeCAD.PNG
In_FreeCAD.PNG (41.78 KiB) Viewed 1663 times
User avatar
wandererfan
Veteran
Posts: 6268
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: Visual differance in PDF and SVG exported Text

Post by wandererfan »

tobiasfalk wrote: Sun May 07, 2023 12:40 pm
I believe that in order to get the exact same representation in the Svg, you would have to embed the font definition in the Svg. Otherwise font substitution will use something similar, but not necessarily identical.

That template specifies the font as "Arial" which is not available on all platforms, so some sans-serif font will be used as a substitution.

I'm no expert on this, so I could be talking rubbish.
User avatar
bensay
Posts: 202
Joined: Wed Dec 22, 2021 8:14 pm
Location: Danmark
Contact:

Re: Visual differance in PDF and SVG exported Text

Post by bensay »

From long far zoom out, it's a known thing, that path text and font text renders different thicknesses, but not on this zoom level. Can you send both the SVG and PDF please?
User avatar
tobiasfalk
Posts: 93
Joined: Fri Feb 05, 2021 2:35 pm

Re: Visual differance in PDF and SVG exported Text

Post by tobiasfalk »

AS said I just used the Standard Template: A4_LandscapeTD.svg
Attachments
E.pdf
(210.68 KiB) Downloaded 28 times
B.svg
(62.86 KiB) Downloaded 21 times
B.pdf
(21.59 KiB) Downloaded 36 times
User avatar
onekk
Veteran
Posts: 6146
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: Visual differance in PDF and SVG exported Text

Post by onekk »

It is not astonishing that the visualization are different, there are some considerations to make even on how the PDF was rendered by the PDF viewer you ae using, some of them are not very precise in things like font kerning and spacing, PDF was thought with a subset of character in mind usually "professionally made fonts" with correct metrics and correct "boxes", usually supplied with the program itself and copyrighted.

You could try to switch from you PDF viewer (provide it is using a different rendering engine) and see if PDF visualization is different.

Regards

Carlo D:
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.

Blog: https://okkmkblog.wordpress.com/
User avatar
tobiasfalk
Posts: 93
Joined: Fri Feb 05, 2021 2:35 pm

Re: Visual differance in PDF and SVG exported Text

Post by tobiasfalk »

In the Origonal post I used Adobe Acrobat Reader.
The SVG Export and then converted to PDF with Inkscape and viewn in KDE Okular:
FreeeCAD_Exported_SVG_u_Inks_tp_PDF_KDEOkular.png
FreeeCAD_Exported_SVG_u_Inks_tp_PDF_KDEOkular.png (34.57 KiB) Viewed 1447 times
The SVG Export and then converted to PDF with Inkscape and viewn in MS Edge:
FreeeCAD_Exported_SVG_u_Inks_tp_PDF_MSEdge.png
FreeeCAD_Exported_SVG_u_Inks_tp_PDF_MSEdge.png (39.14 KiB) Viewed 1447 times
The SVG Export and then converted to PDF with Inkscape and viewn in Gogle Chrome:
FreeeCAD_Exported_SVG_u_Inks_tp_PDF_GoChrome.png
FreeeCAD_Exported_SVG_u_Inks_tp_PDF_GoChrome.png (43.34 KiB) Viewed 1447 times
This was less of an post to ask for fixing it imidiatly but more of documanting that this exists and the posebilaty that one will once look to try to make them all look more simelar. One way that could fix this quit easaly is to change from diractyl exporting to PDF to exporting to SVG and than convert to PDF with incscape or somthin other. This could be done if Incscape is found(a path to it is given)
Post Reply