#1 2015-03-06 17:06:54

lagunero
Member
Registered: 2015-01-06
Posts: 6

Embedding fonts?

Hello, with this code:

var
  doc:TPdfdocumentgdi;
  lpage:tpdfpage;
begin
  doc:=tpdfdocumentgdi.Create;
  doc.DefaultPaperSize:=psA5;
  doc.EmbeddedTTF:=true;
  doc.EmbeddedWholeTTF:=true;
  lpage:=doc.AddPage;
  with doc.VCLCanvas do
  begin
    Font.Name:='HelvMono';
    Font.Style:=[];
    Font.Size:=12;
    Font.Color:=0;
    TextOut(10,10,'something');
  end;
end;

It draws correct the text, and when the font is installed, selecting text and copying with format from acrobat and then opening and pasting in wordpad, for example, you see that in fact the font is HelvMono. But this is so even if you don't use EmbeddedTTF. Instead, if you uninstall the font, then even using EmbeddedTTF, after pasting in wordpad, the font is Arial.

It's possible that this is the way is intended or there is something additional to do, perhaps within acrobat, but I think it shouldn't, if you embed the font is for things like copying with format and pasting would work. Thanks so much.

Offline

#2 2015-03-07 21:03:12

lagunero
Member
Registered: 2015-01-06
Posts: 6

Re: Embedding fonts?

I guess that if the font is not embedded and not installed then it wouldn't draw correctly, and for the copy and pasting thing it would need to be installed, I guess that from Acrobat  or with any app that can read pdf this could be done, if the font is embedded. Bye bye.

Offline

#3 2015-03-08 06:43:52

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,207
Website

Re: Embedding fonts?

Sounds right to me.

Offline

Board footer

Powered by FluxBB