Skip to content

Fix q and x#89

Merged
pelson merged 3 commits intoipython:masterfrom
dummy-index:fix/q_and_x
May 5, 2026
Merged

Fix q and x#89
pelson merged 3 commits intoipython:masterfrom
dummy-index:fix/q_and_x

Conversation

@dummy-index
Copy link
Copy Markdown
Contributor

Resolve multiple issues with q and x.

  • When loading the outline, take into account the amount by which the bounding box expands downward in changeWeight(). (j, q, also x eventually)
  • Improved padding processing when accompanied by changeWeight().
    • c.width is also affected by scale and translation in the x direction, so multiplying it again is unnecessary.
    • The right side bearing of q, which happened to be just right, has returned to the default. Hmm
  • Since the glyph for x had an outline that seemed to suggest multiplication, I modified stage 2. I decided to adopt the outline of x from the first line.
  • Because the x-height is small on the first line, the q and x appear slightly lower. For the time being, I adjusted it with per-character processing. (If done uniformly, the j would also be affected. Since it happens to have a good balance with the i, I want to leave it as is)

_top_ratio = 600 / (600 + 256)
_full_glyph_sizes = {line: span / _top_ratio for line, span in _spans.items()}
_median_full_glyph_size = np.median(list(_full_glyph_sizes.values()))
print(_spans)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's remove the prints.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice - multiplication was on my list (FYI I'm currently looking at all math symbols)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think you should update handwriting.txt to have the multiplication symbol rather than the x.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

xe is still a bit close (or ex is too far appart)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good 👍

@pelson pelson merged commit 3dbc5d1 into ipython:master May 5, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants