Skip to content

25 pdf extracted fonts can not be loaded in browser#26

Open
tomsontom wants to merge 5 commits intom-abboud:masterfrom
BestSolution-at:25-PDF_Extracted_Fonts_can_not_be_loaded_in_Browser
Open

25 pdf extracted fonts can not be loaded in browser#26
tomsontom wants to merge 5 commits intom-abboud:masterfrom
BestSolution-at:25-PDF_Extracted_Fonts_can_not_be_loaded_in_Browser

Conversation

@tomsontom
Copy link

Normalize "Format6SubTable" to default tables if they are not present yet

Closes #25

@m-abboud
Copy link
Owner

m-abboud commented Mar 30, 2021

Awesome thank you for the PR. Code looks good except for some minor formatting issues, don't include spaces inside parentheses blocks (sorry I never set up some sort of linter for this project)

if (getNameTable() == null)
if (getNameTable() == null) {
setName(NameTable.createDefaultTable());
} else {
Copy link
Author

@tomsontom tomsontom Mar 31, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unfortunately these changes surface a bug in NameTable - i have a fix for that but if you want I can rollback those changes and provide another PR to fix this

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the problem is in the offset-computation where there are 2 problems:

  • it's not guaranteed that the length of the string has been computed
  • the offset computation is done BEFORE the entries are sorted
    I think currently one most of the time does not recognize that because if one call normalize() and then getData() the content is correct because on the get data-call

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh if you have a fix for it you can just throw it into this PR. I unfortunately haven't worked on this project in a long time so I'm not really familiar with the specifics here (I also haven't touched java in years either)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PDF Extracted Fonts can not be loaded in Browser

2 participants