Allow resources with no /Font field, they won't cause any problem as long as no call to Tf (to load a font) is made

This commit is contained in:
Tissevert 2020-02-10 17:41:44 +01:00
parent 9f1b1afafe
commit 195446e653

View file

@ -64,8 +64,7 @@ getFontDictionary :: Dictionary -> T Dictionary
getFontDictionary pageDict = getFontDictionary pageDict =
key "Resources" pageDict key "Resources" pageDict
//= getResource //= getResource
\\= key "Font" >>= either (const $ return Map.empty) getResource . key "Font"
>>= getResource
cache :: (ObjectId -> T Font) -> ObjectId -> T Font cache :: (ObjectId -> T Font) -> ObjectId -> T Font
cache loader objectId = cache loader objectId =