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

Re-factor the idFactory functionality, used in the core/-code, and move the fontID generation into it #12070

Merged
merged 1 commit into from
Jul 9, 2020

Commits on Jul 7, 2020

  1. Re-factor the idFactory functionality, used in the core/-code, an…

    …d move the `fontID` generation into it
    
    Note how the `getFontID`-method in `src/core/fonts.js` is *completely* global, rather than properly tied to the current document. This means that if you repeatedly open and parse/render, and then close, even the *same* PDF document the `fontID`s will still be incremented continuously.
    
    For comparison the `createObjId` method, on `idFactory`, will always create a *consistent* id, assuming of course that the document and its pages are parsed/rendered in the same order.
    
    In order to address this inconsistency, it thus seems reasonable to add a new `createFontId` method on the `idFactory` and use that when obtaining `fontID`s. (When the current `getFontID` method was added the `idFactory` didn't actually exist yet, which explains why the code looks the way it does.)
    *Please note:* Since the document id is (still) part of the `loadedName`, it's thus not possible for different documents to have identical font names.
    Snuffleupagus committed Jul 7, 2020
    Configuration menu
    Copy the full SHA
    4cc6797 View commit details
    Browse the repository at this point in the history