{"action":"created","issue":{"url":"https://api.github.com/repos/mozilla/pdf.js/issues/5898","labels_url":"https://api.github.com/repos/mozilla/pdf.js/issues/5898/labels{/name}","comments_url":"https://api.github.com/repos/mozilla/pdf.js/issues/5898/comments","events_url":"https://api.github.com/repos/mozilla/pdf.js/issues/5898/events","html_url":"https://github.com/mozilla/pdf.js/pull/5898","id":65789603,"number":5898,"title":"Extract more accurate glyph heights from type3 fonts","user":{"login":"stri8ed","id":1766843,"avatar_url":"https://avatars.githubusercontent.com/u/1766843?v=3","gravatar_id":"","url":"https://api.github.com/users/stri8ed","html_url":"https://github.com/stri8ed","followers_url":"https://api.github.com/users/stri8ed/followers","following_url":"https://api.github.com/users/stri8ed/following{/other_user}","gists_url":"https://api.github.com/users/stri8ed/gists{/gist_id}","starred_url":"https://api.github.com/users/stri8ed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stri8ed/subscriptions","organizations_url":"https://api.github.com/users/stri8ed/orgs","repos_url":"https://api.github.com/users/stri8ed/repos","events_url":"https://api.github.com/users/stri8ed/events{/privacy}","received_events_url":"https://api.github.com/users/stri8ed/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mozilla/pdf.js/labels/4-font-type3","name":"4-font-type3","color":"DDDDDD"},{"url":"https://api.github.com/repos/mozilla/pdf.js/labels/4-text-selection","name":"4-text-selection","color":"DDDDDD"},{"url":"https://api.github.com/repos/mozilla/pdf.js/labels/4-work-in-progress","name":"4-work-in-progress","color":"0052cc"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2015-04-01T22:08:50Z","updated_at":"2015-04-02T19:21:57Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/mozilla/pdf.js/pulls/5898","html_url":"https://github.com/mozilla/pdf.js/pull/5898","diff_url":"https://github.com/mozilla/pdf.js/pull/5898.diff","patch_url":"https://github.com/mozilla/pdf.js/pull/5898.patch"},"body":"Unlike other font-types, type-3 fonts define a custom transformation from glyph-space to text-space, via the `FontMatrix`. As such, we cannot assume the glyph's to have a height of `1 unit` (as is done currently). By utilizing the `FontBBox` (which is a required property of type-3 fonts), we can get a good estimate of the glyph height.\r\n\r\nFrom the spec:\r\n> The glyph coordinate system is the space in which an individual character’s glyph is defined. All path coordinates and metrics shall be interpreted in glyph space. For all font types except Type 3, the units of glyph space are one-thousandth of a unit of text space; for a Type 3 font, the transformation from glyph space to text space shall be defined by a font matrix specified in an explicit FontMatrix entry in the font.\r\n\r\nAnd\r\n\r\n> A font defines the glyphs at one standard size. This standard is arranged so that the nominal height of tightly spaced lines of text is 1 unit\r\n\r\nImprovements can be verified by text-selection in these PDF's:\r\n\r\nhttp://www.dfki.uni-kl.de/~kieni/publications/spie98.pdf\r\n\r\nhttp://neo.lcc.uma.es/Articles/WRH98.pdf\r\n\r\nFixes #5896."},"comment":{"url":"https://api.github.com/repos/mozilla/pdf.js/issues/comments/89015501","html_url":"https://github.com/mozilla/pdf.js/pull/5898#issuecomment-89015501","issue_url":"https://api.github.com/repos/mozilla/pdf.js/issues/5898","id":89015501,"user":{"login":"stri8ed","id":1766843,"avatar_url":"https://avatars.githubusercontent.com/u/1766843?v=3","gravatar_id":"","url":"https://api.github.com/users/stri8ed","html_url":"https://github.com/stri8ed","followers_url":"https://api.github.com/users/stri8ed/followers","following_url":"https://api.github.com/users/stri8ed/following{/other_user}","gists_url":"https://api.github.com/users/stri8ed/gists{/gist_id}","starred_url":"https://api.github.com/users/stri8ed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stri8ed/subscriptions","organizations_url":"https://api.github.com/users/stri8ed/orgs","repos_url":"https://api.github.com/users/stri8ed/repos","events_url":"https://api.github.com/users/stri8ed/events{/privacy}","received_events_url":"https://api.github.com/users/stri8ed/received_events","type":"User","site_admin":false},"created_at":"2015-04-02T19:21:57Z","updated_at":"2015-04-02T19:21:57Z","body":"I added a check for heights of zero, as per the spec:\r\n>If all four elements of the rectangle are zero, a conforming reader shall make no assumptions about glyph sizes based on the font bounding box."}}