#1 Yesterday 09:17:56

WiWo
Member
Registered: Yesterday
Posts: 3

different Fonts with enbedded PDF viewer in EDGE

I use mormot.ui.pdf to create PDFs from a modified Quickreport export filter. Text writing ist done by VLCCanvas.Textout with previous VCLCanvas.Font setting. Everything works fine, but viewing the PDF with EDGE shows texts with always the same font. Viewing the same PDF with Acrobat Reader shows correct fonts and using the same text source with Microsoft PDF creator shows also correct fonts with EDGE. It seems to be a problem with the combination of Mormot PDF creator and Edge PDF viewer. I tried to disable compression but it didn't help.

Offline

#2 Yesterday 10:52:14

rvk
Member
Registered: 2022-04-14
Posts: 140

Re: different Fonts with enbedded PDF viewer in EDGE

Are you using one of the standard fonts? Or using another font?
If you use another font you need to fully (or partially) embed that font.

pdf.EmbeddedTTF := true;
pdf.EmbeddedTTFIgnore.Text := RawUTF8('Arial'#13#10'Times New Roman'#13#10'Courier New'#13#10'Symbol'#13#10'WingDings');;
pdf.EmbeddedWholeTTF := false;

Do you have an example PDF?

Offline

#3 Yesterday 14:03:21

WiWo
Member
Registered: Yesterday
Posts: 3

Re: different Fonts with enbedded PDF viewer in EDGE

after creating some examples I saw my previous description was not correct. But the issue with the mormot created PDFs and Edge still exists.
I didn't figure out how to upload my demo files to this forum, but I can describe what I've done.
I made 6 text objects on my report with Tahoma, Arial and Courier New, each in standard shape and in italic. In each string I use a comma and a Q, because this are characters with good differences between fonts.
Then I made 3 PDF files: one with Microsoft PDF creator (tw.pdf), one with Mormot and enbedded fonts disabled (t8.pdf) and one with Mormot with enbedded fonts enabled and EmbeddedTTFIgnore.Text := RawUTF8('Arial'#13#10'Courier New'#13#10'Symbol'#13#10'Tahoma'#13#10'Times New Roman') (t6).
Then I opened this 3 files on the same machine in Edge and again in Chrome and there are several differences.
With tw.pdf I cannot see any differences between both viewers and all 6 Strings look correct.
With t6.pdf both viewers the Italic shape is not shown for Tahoma.
With t8.pdf the Chrome viewer shows Tahoma Italic, but the Edge viewer does not.
With t6.pdf the Comma and Q are correct in both viewers for all fonts.
With t8.pdf Q and Comma are not correct for Arial in Edge.

Is there a way to upload theese files?

Offline

#4 Yesterday 19:45:09

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 15,112
Website

Re: different Fonts with enbedded PDF viewer in EDGE

No upload on this forum.
Use an external service please.

It is likely to be a Edge viewer issue, about fonts.
We try to use Acrobat Reader as the reference viewer.

Perhaps try to uncomment the following lines in TPdfFontTrueType.Create:

{    if fFixedWidth then
      flags := PDF_FONT_FIXED_WIDTH else
      flags := 0;
    if (fsItalic in AStyle) and (fOTM.otmItalicAngle<>0) then
      flags := flags or PDF_FONT_ITALIC;
    if flags=0 then
      flags := PDF_FONT_STD_CHARSET;}

Offline

#5 Today 08:40:30

WiWo
Member
Registered: Yesterday
Posts: 3

Re: different Fonts with enbedded PDF viewer in EDGE

I tried this (by changing fsItalic to pfsItalic) but with no difference in Edge. But by using a breakpoint there I figured out why the italic shape is missing in Tahoma: The  fOTM.otmItalicAngle value is 0. Edge ist using this value for Tahoma (but not for the other fonts) but the other PDF viewers don't care about this value.

Offline

Board footer

Powered by FluxBB