Skip to content
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

Config.add_font_file() does not check for font file #8

Open
ashutoshvarma opened this issue Aug 3, 2020 · 1 comment
Open

Config.add_font_file() does not check for font file #8

ashutoshvarma opened this issue Aug 3, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@ashutoshvarma
Copy link
Owner

ashutoshvarma commented Aug 3, 2020

When adding font in pyxpdf with new Config.add_font_file() method if font_path is incorrect(file does not exist) no error is thrown.

Steps to Reproduce:-

from pyxpdf import xpdf as x
doc = x.Document('samples/simple1.pdf')
iout = x.RawImageOutput(d)
iout.get(0).show()                # Output: Syntax Error: Couldn't find a font for 'Helvetica'

x.Config.add_font_file('Helvetica', 'asbajd')
iout.get(0).show()                # Output: Syntax Error: Couldn't find a font for 'Helvetica', Still same error

xpdf error logs are not very clear, we should check whether file exists and is readable in Config.add_font_file() and throw error with appropriate message

@ashutoshvarma ashutoshvarma added the enhancement New feature or request label Aug 3, 2020
@ashutoshvarma
Copy link
Owner Author

added commit which checks for file, but it does not check whether its a valid font file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant