LibPDF: Move Type1FontProgram to use AK::Error instead of PDF::Error

Makes some of the errors a bit less descriptive. But this is pretty
stable by now and the errors fire basically never, so that seems ok.

Needing the explicit `AK::` prefix is a bit awkward, but that'll go
away once this class moves out of LibPDF.

Move error() into the two subclasses. I'll remove it from CFF in
a follow-up.

No real behavior change.
This commit is contained in:
Nico Weber 2024-04-14 09:08:47 -04:00 committed by Andreas Kling
commit 102ac331c6
Notes: sideshowbarker 2024-07-17 04:10:16 +09:00
6 changed files with 62 additions and 39 deletions

View file

@ -237,4 +237,19 @@ bool PS1FontProgram::seek_name(Reader& reader, ByteString const& name)
return false;
}
Error PS1FontProgram::error(
ByteString const& message
#ifdef PDF_DEBUG
,
SourceLocation loc
#endif
)
{
#ifdef PDF_DEBUG
dbgln("\033[31m{} Type 1 font error: {}\033[0m", loc, message);
#endif
return Error { Error::Type::MalformedPDF, message };
}
}