Skip to content

kerning seems generally wrong #14887

Closed

Description

@anntzer

Bug report

Bug summary

Matplotlib seems to fail to apply kerning correctly.

Code for reproduction

figtext(.5, .5, "AV", size=36); figtext(.5, .4, "Te", size=36)

Actual outcome

test
and similarly for pdf/ps/svg output.

Expected outcome

with mplcairo, one gets:
cairo

Note that it's not that matplotlib doesn't apply kerning at all -- there is definitely code a bit everywhere to apply it, but it looks like we're getting wrong values. See also https://matplotlib.org/gallery/misc/font_indexing.html which shows that get_kerning apparently returns 0 when it shouldn't.

Matplotlib version

  • Operating system: linux
  • Matplotlib version: master
  • Matplotlib backend (print(matplotlib.get_backend())): agg/mplcairo
  • Python version: 37
  • Jupyter version (if applicable):
  • Other libraries:

Activity

  1. QuLogic commented on Jul 26, 2019

    @QuLogic
    Member

    I think I've figured this out, but I don't expect this to be good for our test images...

  2. anntzer commented on Jul 26, 2019

    @anntzer
    ContributorAuthor

    I guess we could fix #9681 (kill hinting_factor) at the same time, if we do go that route :p
    or we could just bite the bullet and add a dependency on harfbuzz (which is packaged by conda-forge on all three supported OSes -- https://anaconda.org/conda-forge/harfbuzz) and fix all MEP14 issues...

  3. QuLogic commented on Jul 29, 2019

    @QuLogic
    Member

    Hmm, well that one breaks an order of magnitude more tests, so perhaps not as easy as this one. It may be even possible to fix it with some rc param that allows not changing any test.

  4. anntzer commented on Jul 29, 2019

    @anntzer
    ContributorAuthor

    Fair enough.

  5. added this to the v3.2.0 milestone on Aug 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions