mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 00:25:12 +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:
committed by
Andreas Kling
parent
c592b889bf
commit
1ec4ad5eb6
@@ -171,6 +171,14 @@ CharDescriptor const& Encoding::get_char_code_descriptor(u16 char_code) const
|
||||
return const_cast<Encoding*>(this)->m_descriptors.ensure(char_code);
|
||||
}
|
||||
|
||||
u16 Encoding::get_char_code(DeprecatedString const& name) const
|
||||
{
|
||||
auto code_iterator = m_name_mapping.find(name);
|
||||
if (code_iterator != m_name_mapping.end())
|
||||
return code_iterator->value;
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool Encoding::should_map_to_bullet(u16 char_code) const
|
||||
{
|
||||
// PDF Annex D table D.2, note 3:
|
||||
|
||||
Reference in New Issue
Block a user