Skip to content

Broken characters with FreeSerif and no hinting  #18252

Closed
@QuLogic

Description

@QuLogic

The FreeSerif font produces strange output when hinting is disabled. This is not a default configuration (which is force_autohint), but is set when building tests.

import matplotlib.pyplot as plt

plt.rcParams['text.hinting'] = 'none'  # 'force_autohint'

fig, ax = plt.subplots()
kw = {'font': 'freeserif', 'fontsize': 14}
# characters where Free Serif uses various scales and linear transforms
# e.g. the right paren is a reflected left paren
ax.text(.05, .1, "parens, FAX, u with two diacritics: ()℻ǘ", **kw)
ax.text(.05, .2, "double arrows LURD, single arrows LURD: ⇐⇑⇒⇓←↑→↓", **kw)
ax.text(.05, .3, "corner arrows, wreath product: ↴↵≀", **kw)
ax.set_xticks([])
ax.set_yticks([])

fig.savefig(f'hinting-{plt.rcParams["text.hinting"]}.png')
fig.savefig(f'hinting-{plt.rcParams["text.hinting"]}.pdf')
fig.savefig(f'hinting-{plt.rcParams["text.hinting"]}.svg')

ttconv_transforms

Originally posted by @jkseppan in #18081 (comment)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions