-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(fonts): adds docs and tests for potentially missing language pack #9
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. So did you not have to bust the cache for the node modules in Circle?
@sjl2 Apparently this project doesn't use caching for CircleCI. We may need to bust the cache in lob-api. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PDF is blank when I view it. Is this because I'm missing the Language Pack fonts?
sudo sh -c 'echo "deb http://archive.debian.org/debian jessie-backports main" >> /etc/apt/sources.list' | ||
sudo sh -c 'echo "deb-src http://archive.debian.org/debian jessie-backports main" >> /etc/apt/sources.list' | ||
sudo apt-get update -o Acquire::Check-Valid-Until=false -o Acquire::CompressionTypes::Order::=gz | ||
sudo apt-get install -y --no-install-recommends g++-4.9 libpoppler-private-dev poppler-data lcov |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to also run these commands on our docker image?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you mean on Lob API? Theres a PR for that here: https://github.com/lob/lob-api/pull/5270
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, my bad. I thought this was a lob-api fix PR. Ignore my comment.
@marklee22 Yeah the blank PDF is on purpose. I took the actual customer PDF that was causing the issue and removed all content from it for privacy reasons. Whats interesting is that the PDF looks blank but it still contains empty text that uses these bad fonts. So...pretty messed up PDFs to begin with. |
What
poppler-data
to the required library docsWhy
Recently Quantum reached out with some letter IDs that contained non-standard un-embedded fonts. We ran the PDFs through Adobe preflight (see screenshot), and even
pdffonts
locally and confirmed that there were non-standard un-embedded fonts.It turns out that these fonts required an additional poppler package
poppler-data
to properly detect them usingpdffonts
. Otherwise, those fonts would be ignored and a warning would be thrown:This isn't explicitly necessary on our dev laptops because the homebrew formula we use also installs
poppler-data
.To be clear, the changes in this PR won't fix the bug in lob-api since the fix is dependent on a system-installed dependency, but these changes document this corner-case.