Text resized when PDF is imported
Moderator: andrew
Forum rules
Always indicate your operating system and QCAD version.
Attach drawing files and screenshots.
Post one question per topic.
Always indicate your operating system and QCAD version.
Attach drawing files and screenshots.
Post one question per topic.
Text resized when PDF is imported
I can't see any settings to adjust so I think this may be a bug of some kind.
I have a PDF of the frame and title block my employer uses. It is an A4 PDF. I can import it into QCAD fine, and the geometry/lines all come in the right weight, colour, etc, but the text is coming in slightly too large, and some lines of text are breaking out of the boxes they are supposed to be within.
Here is a screen grab of the original PDF. (It looks fine in both PDF Viewer and Illustrator) And here is a screenshot of the same PDF placed in QCAD. I gather PDF import is a fairly recent addition to QCAD. I suspect there may be a little tweaking required. Unless there is some setting hidden away somewhere.
Regards,
Derek
I have a PDF of the frame and title block my employer uses. It is an A4 PDF. I can import it into QCAD fine, and the geometry/lines all come in the right weight, colour, etc, but the text is coming in slightly too large, and some lines of text are breaking out of the boxes they are supposed to be within.
Here is a screen grab of the original PDF. (It looks fine in both PDF Viewer and Illustrator) And here is a screenshot of the same PDF placed in QCAD. I gather PDF import is a fairly recent addition to QCAD. I suspect there may be a little tweaking required. Unless there is some setting hidden away somewhere.
Regards,
Derek
QCAD Version 3.29.4 : Windows 10
Re: Text resized when PDF is imported
Hi,
I failed to reproduce the issue. Any chance that you post the pdf ...?
I failed to reproduce the issue. Any chance that you post the pdf ...?
Work smart, not hard: QCad Pro
Win10/64, QcadPro, QcadCam version: Current.
If a thread is considered as "solved" please change the title of the first post to "[solved] Title..."
Win10/64, QcadPro, QcadCam version: Current.
If a thread is considered as "solved" please change the title of the first post to "[solved] Title..."
Re: Text resized when PDF is imported
It's a document/template for work, so I'd rather not post it on an open forum, but if you PM me with an email, I could send it direct to you..?
QCAD Version 3.29.4 : Windows 10
Re: Text resized when PDF is imported
Understandable! Please feel free to use my forum PM (Contact below avatar) and the file will stay confidential.
Work smart, not hard: QCad Pro
Win10/64, QcadPro, QcadCam version: Current.
If a thread is considered as "solved" please change the title of the first post to "[solved] Title..."
Win10/64, QcadPro, QcadCam version: Current.
If a thread is considered as "solved" please change the title of the first post to "[solved] Title..."
Re: Text resized when PDF is imported
Thanks
I realised after my last message that I could probably attach it to a PM, but by then I'd already switched my laptop off as it was past midnight. Doh!
I'll message you tomorrow with the PDF.
Cheers,
Derek
I realised after my last message that I could probably attach it to a PM, but by then I'd already switched my laptop off as it was past midnight. Doh!
I'll message you tomorrow with the PDF.
Cheers,
Derek
QCAD Version 3.29.4 : Windows 10
Re: Text resized when PDF is imported
Derek,
Remark that QCAD may fall-back on the nearest installed font available on your system for rendering.
Remark also that QCAD doesn't support all kinds of text formatting found in some other applications.
For that one needs to investigate the source and maybe the dxf source.
Regards,
CVH
Remark that QCAD may fall-back on the nearest installed font available on your system for rendering.
Remark also that QCAD doesn't support all kinds of text formatting found in some other applications.
For that one needs to investigate the source and maybe the dxf source.
Regards,
CVH
Re: Text resized when PDF is imported
Hi CVH,
We are both using the same font, but I did consider that it may be that my font on my laptop may be different to the font on my colleague's computer, but that really shouldn't affect the size visibly as much as it is.
Good point about the text formatting that other software has. I don't know for certain if the original document has been done in Illustrator or a CAD program: I'm trying to establish that. Having said that, I could understand if the kerning or horizontal compression was all wrong, but the text is clearly too big overall.
I've sent Husky a PM with the file attached. I'll send you one too, just in case you have a moment to import it and see what it looks like on your screen.
Regards,
Derek
We are both using the same font, but I did consider that it may be that my font on my laptop may be different to the font on my colleague's computer, but that really shouldn't affect the size visibly as much as it is.
Good point about the text formatting that other software has. I don't know for certain if the original document has been done in Illustrator or a CAD program: I'm trying to establish that. Having said that, I could understand if the kerning or horizontal compression was all wrong, but the text is clearly too big overall.
I've sent Husky a PM with the file attached. I'll send you one too, just in case you have a moment to import it and see what it looks like on your screen.
Regards,
Derek
QCAD Version 3.29.4 : Windows 10
Re: Text resized when PDF is imported
Yes it does ... Fonts are very complex things.
https://en.wikipedia.org/wiki/TrueType ... To start with.
Here the rendered text matches Arial for 100%.
I don't have access to or any information over a font called 'ONZYPV+CenturyGothic'.
Regards,
CVH
Re: Text resized when PDF is imported
Hi Derek,
The pdf has 2 stored fonts. Arial and CenturyGothic.
Inside the pdf those fonts are stored as IWZTJH+Arial and ONZYPV+CenturyGothic.
Those names are "correctly" read by QCAD as IWZTJH+Arial and ONZYPV+CenturyGothic. Correctly doesn't means it knows what to do with it ...
I have no idea where those pdf font names come from! Correct name would be Arial and CenturyGothic.
Note: Other programs are able to read the text correctly - QCAD not.
Easiest way to fix the issue would be to get that template as a dxf/dwg/svg. PDF is not really meant to provide those specific information.
If you need to stick to the pdf load it into QCAD, scale the Text Hight below Menu/Edit to 0.816, substitute those fonts and save it for further processing as dxf. Not perfect but close ...
Not sure if this is a QCAD or pdf problem. Me discovering those weird font names in the pdf makes me thinking it is a pdf problem ...
The pdf loads on my machine the same way like on your machine.
The pdf has 2 stored fonts. Arial and CenturyGothic.
Inside the pdf those fonts are stored as IWZTJH+Arial and ONZYPV+CenturyGothic.
Those names are "correctly" read by QCAD as IWZTJH+Arial and ONZYPV+CenturyGothic. Correctly doesn't means it knows what to do with it ...
I have no idea where those pdf font names come from! Correct name would be Arial and CenturyGothic.
Note: Other programs are able to read the text correctly - QCAD not.
Easiest way to fix the issue would be to get that template as a dxf/dwg/svg. PDF is not really meant to provide those specific information.
If you need to stick to the pdf load it into QCAD, scale the Text Hight below Menu/Edit to 0.816, substitute those fonts and save it for further processing as dxf. Not perfect but close ...
Not sure if this is a QCAD or pdf problem. Me discovering those weird font names in the pdf makes me thinking it is a pdf problem ...
Work smart, not hard: QCad Pro
Win10/64, QcadPro, QcadCam version: Current.
If a thread is considered as "solved" please change the title of the first post to "[solved] Title..."
Win10/64, QcadPro, QcadCam version: Current.
If a thread is considered as "solved" please change the title of the first post to "[solved] Title..."
Re: Text resized when PDF is imported
Scaling fonts scales the text width property too.
This was 1 and scales to 0.816, zero means no column width.
It is known that using a non-zero value for column width renders slower on viewports in combination with 'Text rendering as text'.
The solution is twofold:
- Render text as paths, see: menu Edit .. Application Preferences .. Graphic View .. Text Rendering.
- Select all text entities and set the text width property to zero.
Regards,
CVH
This was 1 and scales to 0.816, zero means no column width.
It is known that using a non-zero value for column width renders slower on viewports in combination with 'Text rendering as text'.
The solution is twofold:
- Render text as paths, see: menu Edit .. Application Preferences .. Graphic View .. Text Rendering.
- Select all text entities and set the text width property to zero.
Regards,
CVH
Re: Text resized when PDF is imported
Additionally:
A pdf created by QCAD using Arial & CenturyGothic imports just fine in QCAD ...
Regards,
CVH
A pdf created by QCAD using Arial & CenturyGothic imports just fine in QCAD ...
Regards,
CVH
Re: Text resized when PDF is imported
I know. I worked in publishing for twenty years, and spent a lot of time dealing with typefaces. I have created a handful of fonts. The proportions of ascender/descender heights, the x height can vary wildly, and depending on how much space the typeface occupies between baselines different typefaces can be different sizes but Arial and Century Gothic have almost identical metrics, and there shouldn't be that amount of visible change (see image below).
I'm might be misunderstandign what you're meaning here, because the text on screen is most definitely Century Gothic, not Arial.
Cheers,
Derek
QCAD Version 3.29.4 : Windows 10
Re: Text resized when PDF is imported
That's a relief, Kind of.
I've no idea where those font names come from either. I'm wondering if when the PDF is generated, it is only embedding the glyphs used in the document rather than the entire font, and a 'subset' font is being generated. I'm going to dig into this with FontForge, as that can extract fonts from documents.Husky wrote: ↑Fri Jun 09, 2023 11:04 pmInside the pdf those fonts are stored as IWZTJH+Arial and ONZYPV+CenturyGothic.
Those names are "correctly" read by QCAD as IWZTJH+Arial and ONZYPV+CenturyGothic. Correctly doesn't means it knows what to do with it ...
I have no idea where those pdf font names come from! Correct name would be Arial and CenturyGothic.
Puzzling.
Great tip. Scaling the text height is a decent solution because I can resize all the text in one go, instead of having to change every text element individually.
I have come across some other slightly odd behaviour with Century Gothic. I'll post it in a separate comment. It may be related, it may not be.
Cheers,
Derek
QCAD Version 3.29.4 : Windows 10
Re: Text resized when PDF is imported
Well that's good news! I may well just end up creating it from scratch in QCAD...
QCAD Version 3.29.4 : Windows 10
Re: Text resized when PDF is imported
Okay, so here's the other thing I've noticed. (I'm not calling it a bug, just an observation.)
So I create a QCAD document, and add some text, using Century Gothic. (Just because that's one that I'm having issues with)
I export the document as a PDF, and open it in a PDF viewer. All good.
Just out of curiosity, I open the PDF in Illustrator. Upon opening, I get the following message: So despite being created using a font on my computer, there is a font that it can't find. It is looking for a font called CenturyGothicRegular, though it shouldn't be because I never used such a font. The possible font names on my PC are either 'Century Gothic' or 'Century Regular'.
I click 'OK/whatever', and it opens up substituting the default font (probably Arial) and it all looks wrong.
I highlight the text, and change it to Century Gothic, as it should be, and everything looks correct, although each character is now a separate element.
So... The exported PDF from QCAD looks right in a PDF viewer, but when opened in a different program that does more than just show the contents and allows for editing, there is clearly an issue. What I think is happening is that when exporting the PDF, QCAD is combining the name of the font which is 'Century Gothic' with the font weight, which is 'Regular'(seen in the above screengrab), and telling the document that there is a font called 'CenturyGothicRegular', which doesn't exist.
I'm pretty certain that this is what is happening with the other fonts, where the PDF I was initially having issues with was claiming to be using fonts called IWZTJH+Arial and ONZYPV+CenturyGothic. Clearly these fonts don't exist either, but whatever software is being used to export that PDF is doing similar to what QCAD is doing, but is prepending the actual font names with other seemingly random characters.
Century Gothic will not be the only font this behaviour occurs on. I suspect every font will be appended with 'Regular, Bold, etc.
Is it a bug? Possibly. But QCAD is clearly not alone in this behaviour. And I think this behaviour sheds a little light on my initial issue. Probably doesn't get me closer to a solution, but it is food for thought.
Also, with it being an issue present in software other than QCAD as well, it makes life difficult when transferring documents across sites, and having different users editing the PDFs. Getting a copy of that PDF document in a different format such as dxf is probably the best option, removing all the dodgy conversion stuff going on when PDFs are exported.
Regards,
Derek
So I create a QCAD document, and add some text, using Century Gothic. (Just because that's one that I'm having issues with)
I export the document as a PDF, and open it in a PDF viewer. All good.
Just out of curiosity, I open the PDF in Illustrator. Upon opening, I get the following message: So despite being created using a font on my computer, there is a font that it can't find. It is looking for a font called CenturyGothicRegular, though it shouldn't be because I never used such a font. The possible font names on my PC are either 'Century Gothic' or 'Century Regular'.
I click 'OK/whatever', and it opens up substituting the default font (probably Arial) and it all looks wrong.
I highlight the text, and change it to Century Gothic, as it should be, and everything looks correct, although each character is now a separate element.
So... The exported PDF from QCAD looks right in a PDF viewer, but when opened in a different program that does more than just show the contents and allows for editing, there is clearly an issue. What I think is happening is that when exporting the PDF, QCAD is combining the name of the font which is 'Century Gothic' with the font weight, which is 'Regular'(seen in the above screengrab), and telling the document that there is a font called 'CenturyGothicRegular', which doesn't exist.
I'm pretty certain that this is what is happening with the other fonts, where the PDF I was initially having issues with was claiming to be using fonts called IWZTJH+Arial and ONZYPV+CenturyGothic. Clearly these fonts don't exist either, but whatever software is being used to export that PDF is doing similar to what QCAD is doing, but is prepending the actual font names with other seemingly random characters.
Century Gothic will not be the only font this behaviour occurs on. I suspect every font will be appended with 'Regular, Bold, etc.
Is it a bug? Possibly. But QCAD is clearly not alone in this behaviour. And I think this behaviour sheds a little light on my initial issue. Probably doesn't get me closer to a solution, but it is food for thought.
Also, with it being an issue present in software other than QCAD as well, it makes life difficult when transferring documents across sites, and having different users editing the PDFs. Getting a copy of that PDF document in a different format such as dxf is probably the best option, removing all the dodgy conversion stuff going on when PDFs are exported.
Regards,
Derek
QCAD Version 3.29.4 : Windows 10