Skip to content

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented Mar 27, 2025

Minor preparatory PRs for #29807:

  1. Move listing of Type1 glyph widths to backend_pdf:
    DviFont.widths (the widths of each glyph in a font) is only used
    by backend_pdf to embed (classic, Type1) TeX fonts; deprecate that
    attribute and instead compute it where needed. This change is in
    preparation for supporting {xe,lua}tex, where DviFont can also refer to
    OpenType fonts which would be embedded via a different mechanism into
    the pdf file, and which can contain so many glyphs that explicitly
    listing the width of each one would be wasteful.

  2. Rename the confusingly named dviread._mul2012:
    Dvi fixed-point values are in 12.20 format (12 bits before the decimal
    point, 20 bits after -- see e.g. the 20-bit bitshifts scattered in the
    dviread module), not 20.12. Rename the helper function accordingly.

  3. Clarify doc for Tfm.design_size.:
    See spec in texdoc tftopl section 10 and texdoc dvitype section 18.

PR summary

PR checklist

@anntzer anntzer force-pushed the opentypedvi-prepare branch 2 times, most recently from 38c33e6 to b49c6dc Compare March 27, 2025 15:07
@anntzer anntzer marked this pull request as ready for review March 27, 2025 15:07
@anntzer anntzer force-pushed the opentypedvi-prepare branch from b49c6dc to f53d9ae Compare March 27, 2025 17:45
anntzer added 2 commits March 27, 2025 22:13
DviFont.widths (the widths of each glyph in a font) is only used
by backend_pdf to embed (classic, Type1) TeX fonts; deprecate that
attribute and instead compute it where needed.  This change is in
preparation for supporting {xe,lua}tex, where DviFont can also refer to
OpenType fonts which would be embedded via a different mechanism into
the pdf file, and which can contain so many glyphs that explicitly
listing the width of each one would be wasteful.
Dvi fixed-point values are in 12.20 format (12 bits before the decimal
point, 20 bits after -- see e.g. the 20-bit bitshifts scattered in the
dviread module), not 20.12.  Rename the helper function accordingly.
@anntzer anntzer force-pushed the opentypedvi-prepare branch from f53d9ae to ae3d057 Compare March 27, 2025 21:14
@QuLogic QuLogic added this to the v3.11.0 milestone Mar 27, 2025
See spec in `texdoc tftopl` section 10 and `texdoc dvitype` section 18.
@anntzer
Copy link
Contributor Author

anntzer commented Mar 27, 2025

Added a third doc-only commit.

@timhoffm timhoffm merged commit b2b76d6 into matplotlib:main Mar 27, 2025
39 of 41 checks passed
@anntzer anntzer deleted the opentypedvi-prepare branch March 28, 2025 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants