mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 08:27:45 +00:00
LibPDF/CFF: Add enum values for remaining PrivDictOperators
No behavior change, except that we now dbgln() if we see a PrivDictOperator we don't know about. (I haven't seen this in practice, but I found this useful while debugging things.)
This commit is contained in:
parent
7833dc0f5a
commit
8e7cb11856
2 changed files with 36 additions and 0 deletions
|
@ -184,6 +184,25 @@ PDFErrorOr<NonnullRefPtr<CFF>> CFF::create(ReadonlyBytes const& cff_bytes, RefPt
|
||||||
Reader priv_dict_reader { cff_bytes.slice(private_dict_offset, private_dict_size) };
|
Reader priv_dict_reader { cff_bytes.slice(private_dict_offset, private_dict_size) };
|
||||||
TRY(parse_dict<PrivDictOperator>(priv_dict_reader, [&](PrivDictOperator op, Vector<DictOperand> const& operands) -> PDFErrorOr<void> {
|
TRY(parse_dict<PrivDictOperator>(priv_dict_reader, [&](PrivDictOperator op, Vector<DictOperand> const& operands) -> PDFErrorOr<void> {
|
||||||
switch (op) {
|
switch (op) {
|
||||||
|
case PrivDictOperator::BlueValues:
|
||||||
|
case PrivDictOperator::OtherBlues:
|
||||||
|
case PrivDictOperator::FamilyBlues:
|
||||||
|
case PrivDictOperator::FamilyOtherBlues:
|
||||||
|
case PrivDictOperator::BlueScale:
|
||||||
|
case PrivDictOperator::BlueShift:
|
||||||
|
case PrivDictOperator::BlueFuzz:
|
||||||
|
case PrivDictOperator::StemSnapH:
|
||||||
|
case PrivDictOperator::StemSnapV:
|
||||||
|
case PrivDictOperator::ForceBold:
|
||||||
|
case PrivDictOperator::LanguageGroup:
|
||||||
|
case PrivDictOperator::ExpansionFactor:
|
||||||
|
case PrivDictOperator::InitialRandomSeed:
|
||||||
|
// Ignore hinting-related operators for now.
|
||||||
|
break;
|
||||||
|
case PrivDictOperator::StdHW:
|
||||||
|
case PrivDictOperator::StdVW:
|
||||||
|
// FIXME: What do these do?
|
||||||
|
break;
|
||||||
case PrivDictOperator::Subrs: {
|
case PrivDictOperator::Subrs: {
|
||||||
// CFF spec, "16 Local/Global Subrs INDEXes"
|
// CFF spec, "16 Local/Global Subrs INDEXes"
|
||||||
// "Local subrs are stored in an INDEX structure which is located via the offset operand of the Subrs operator in the Private DICT."
|
// "Local subrs are stored in an INDEX structure which is located via the offset operand of the Subrs operator in the Private DICT."
|
||||||
|
@ -203,6 +222,8 @@ PDFErrorOr<NonnullRefPtr<CFF>> CFF::create(ReadonlyBytes const& cff_bytes, RefPt
|
||||||
if (!operands.is_empty())
|
if (!operands.is_empty())
|
||||||
nominalWidthX = to_number(operands[0]);
|
nominalWidthX = to_number(operands[0]);
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
dbgln("CFF: Unhandled private dict entry {}", static_cast<int>(op));
|
||||||
}
|
}
|
||||||
return {};
|
return {};
|
||||||
}));
|
}));
|
||||||
|
|
|
@ -51,6 +51,21 @@ private:
|
||||||
|
|
||||||
// CFF spec, "Table 23 Private DICT Operators"
|
// CFF spec, "Table 23 Private DICT Operators"
|
||||||
enum class PrivDictOperator {
|
enum class PrivDictOperator {
|
||||||
|
BlueValues = 6,
|
||||||
|
OtherBlues,
|
||||||
|
FamilyBlues,
|
||||||
|
FamilyOtherBlues,
|
||||||
|
BlueScale = (12 << 8 | 9),
|
||||||
|
BlueShift,
|
||||||
|
BlueFuzz,
|
||||||
|
StdHW = 10,
|
||||||
|
StdVW,
|
||||||
|
StemSnapH = (12 << 8 | 12),
|
||||||
|
StemSnapV,
|
||||||
|
ForceBold,
|
||||||
|
LanguageGroup = (12 << 8 | 17),
|
||||||
|
ExpansionFactor,
|
||||||
|
InitialRandomSeed,
|
||||||
Subrs = 19,
|
Subrs = 19,
|
||||||
DefaultWidthX,
|
DefaultWidthX,
|
||||||
NominalWidthX,
|
NominalWidthX,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue