| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
There was a problem hiding this comment.
Can't say I understand PostScript, but this seems reasonable from what I read of the spec.
Sorry, something went wrong.
| """.format(font_name=font.postscript_name, | ||
| inv_units_per_em=1 / font.units_per_EM, | ||
| bbox=" ".join(map(str, font.bbox)), | ||
| encoding=" ".join("/{}".format(font.get_glyph_name(glyph_id)) |
There was a problem hiding this comment.
Is this safe, or do you need to escape any Postscript special values?
Sorry, something went wrong.
There was a problem hiding this comment.
this should be safe per https://github.com/adobe-type-tools/agl-specification#6-assigning-glyph-names-in-new-fonts. We can always revisit if someone finds a font with a bad glyph name...
Sorry, something went wrong.
|
I also moved the bind defs to the global mpldict, which avoids having to repeat them for every font. |
Sorry, something went wrong.
There was a problem hiding this comment.
I almost dare approve based on my non-existing postscript knowledge, modulo a docstring that can at least give me an idea.
Sorry, something went wrong.
... similarly to the change for pdf, but easier because there are no
baseline images for which we need to provide bug-level backcompat :-)
Drop the FontInfo metadata (which is explicitly optional in the
PostScript spec) to avoid having to figure out the correct encoding
(which can be quite obscure).
Replace the implementation of the `_sc` command from
`7 -1 roll{setcachedevice}{pop pop pop pop pop pop}ifelse` to a plain
`setcachedevice` (as I cannot see any case where the "other" branch is
taken).
Drop the splitting of long commands using `exec` (`_e`) -- this is only
needed for level-1 postscript, which has a small fixed stack size; we
output level-2 postscript (per backend_version) and I guess level-1 is
rarely in use nowadays anyways (probably the feature could be added back
if there's really demand for it, but let's not get ahead of ourselves).
Previously, some composite characters would be output in a "compressed"
form (e.g., accented characters would be recorded as "draw the accent,
then run the charproc for the unaccented character"). This is lost, but
I'd guess outputting .ps.gz is better if compression really matters.
| Back | FazBrowse Home | New Git URL |
... similarly to the change for pdf (#18181), but easier because there are no
baseline images for which we need to provide bug-level backcompat :-)
Drop the FontInfo metadata (which is explicitly optional in the
PostScript spec) to avoid having to figure out the correct encoding
(which can be quite obscure).
Replace the implementation of the _sc command from
7 -1 roll{setcachedevice}{pop pop pop pop pop pop}ifelse to a plain
setcachedevice (as I cannot see any case where the "other" branch is
taken).
Drop the splitting of long commands using exec (_e) -- this is only
needed for level-1 postscript, which has a small fixed stack size; we
output level-2 postscript (per backend_version) and I guess level-1 is
rarely in use nowadays anyways (probably the feature could be added back
if there's really demand for it, but let's not get ahead of ourselves).
Previously, some composite characters would be output in a "compressed"
form (e.g., accented characters would be recorded as "draw the accent,
then run the charproc for the unaccented character"). This is lost, but
I'd guess outputting .ps.gz is better if compression really matters.
PR Summary
PR Checklist