mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 06:47:35 +00:00
LibPDF: Add name -> char code conversion in Encoding
This is an operation that was already being done (sub-optimally) in PS1FontProgram, so we are replacing that. We will use this during CFF parsing too.
This commit is contained in:
parent
c592b889bf
commit
1ec4ad5eb6
3 changed files with 11 additions and 2 deletions
|
@ -92,8 +92,8 @@ PDFErrorOr<void> PS1FontProgram::parse_encrypted_portion(ByteBuffer const& buffe
|
|||
if (rd == "-|" || rd == "RD") {
|
||||
auto line = TRY(decrypt(reader.bytes().slice(reader.offset(), encrypted_size), m_encryption_key, m_lenIV));
|
||||
reader.move_by(encrypted_size);
|
||||
auto name_mapping = encoding()->name_mapping();
|
||||
auto char_code = name_mapping.ensure(word.substring_view(1));
|
||||
auto glyph_name = word.substring_view(1);
|
||||
auto char_code = encoding()->get_char_code(glyph_name);
|
||||
GlyphParserState state;
|
||||
TRY(add_glyph(char_code, TRY(parse_glyph(line, subroutines, state, false))));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue