DescendantFonts will never be used in Font::decodeContent()
Open
Nobody has claimed this yet.
bug
de-/encoding issue
- Dominant language
- PHP
- Stars
- 2.7k
- Forks
- 579
- Avg merge
- 2m
- Merged PRs (30d)
- 1
Description
Because Font::translateChar() will never return false:
Seems that translateChar() must not return self::MISSING and possible $fallbackDecoded if char not fount in $this->table map.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/Smalot/PdfParser/Font.php at decodeContent() around lines 393-395, then trace translateChar() around lines 92-118 and its handling of missing characters. Check the existing test suite for font decoding behavior. Done means the DescendantFonts path is reachable when the character is absent from the table, with tests confirming the resulting decoding behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100