LibPDF: Fix symbol for text_next_line_show_string_set_spacing operator

It's `"`, not `''`.

Now the `text_next_line_show_string_set_spacing` gets called and logs
a TODO at page render time if `"` is used in a PDF:

    warning: Rendering of feature not supported:
        draw operation: text_next_line_show_string_set_spacing

It caused a parse error (also at page render time) previously:

    [parse_value @ .../LibPDF/Parser.cpp:104]
        Parser error at offset 611: Unexpected char """
This commit is contained in:
Nico Weber 2023-07-22 11:11:53 -04:00 committed by Tim Flynn
parent 18b86b1868
commit 77e6dbab33
Notes: sideshowbarker 2024-07-17 06:29:49 +09:00
2 changed files with 3 additions and 3 deletions

View file

@ -106,7 +106,7 @@ public:
if (symbol_string == "'")
return OperatorType::TextNextLineShowString;
if (symbol_string == "''")
if (symbol_string == "\"")
return OperatorType::TextNextLineShowStringSetSpacing;
dbgln("unsupported graphics symbol {}", symbol_string);
@ -140,7 +140,7 @@ public:
if (operator_type == OperatorType::TextNextLineShowString)
return "'";
if (operator_type == OperatorType::TextNextLineShowStringSetSpacing)
return "''";
return "\"";
VERIFY_NOT_REACHED();
}

View file

@ -526,7 +526,7 @@ PDFErrorOr<Vector<Operator>> Parser::parse_operators()
Vector<Value> operator_args;
constexpr static auto is_operator_char = [](char ch) {
return isalpha(ch) || ch == '*' || ch == '\'';
return isalpha(ch) || ch == '*' || ch == '\'' || ch == '"';
};
m_reader.consume_whitespace();