fcl-pdf: using EPDF

(cherry picked from commit 85338e2d05)
This commit is contained in:
mattias 2023-11-06 08:44:45 +01:00 committed by marcoonthegit
parent b13056fcf2
commit 638b81dcaa

View File

@ -1730,7 +1730,7 @@ begin
exit;
// only create objects when needed
if FTextMappingList<>nil then
Exception.Create('TPDFFont.PrepareTextMapping already created');
EPDF.Create('TPDFFont.PrepareTextMapping already created');
FTextMappingList := TTextMappingList.Create;
FTrueTypeFile := TTFFileInfo.Create;
if FFontStream<>nil then
@ -1832,9 +1832,9 @@ procedure TPDFFont.LoadFromStream(aStream: TStream);
begin
if FFontStream=aStream then Exit;
if FFontStream<>nil then
raise Exception.Create('TPDFFont.SetFontStream has already a stream');
raise EPDF.Create('TPDFFont.SetFontStream has already a stream');
if FFontFilename<>'' then
raise Exception.Create('TPDFFont.SetFontStream has already a file');
raise EPDF.Create('TPDFFont.SetFontStream has already a file');
FFontStream:=TMemoryStream.Create;
FFontStream.CopyFrom(aStream,aStream.Size-aStream.Position);
PrepareTextMapping;
@ -3881,7 +3881,7 @@ var
CompressedStream: TMemoryStream;
begin
if ADocument.Fonts[AFontNum].SubsetFont = nil then
raise Exception.Create('WriteEmbeddedSubsetFont: SubsetFont stream was not initialised.');
raise EPDF.Create('WriteEmbeddedSubsetFont: SubsetFont stream was not initialised.');
WriteString(CRLF+'stream'+CRLF, AOutStream);
PS := AOutStream.Position;
if poCompressFonts in ADocument.Options then