Skip to content

WIP: Switch to ab_glyph#7

Draft
okin wants to merge 3 commits into
jeffersoncbd:mainfrom
okin:switch_to_ab_glyph
Draft

WIP: Switch to ab_glyph#7
okin wants to merge 3 commits into
jeffersoncbd:mainfrom
okin:switch_to_ab_glyph

Conversation

@okin

@okin okin commented Feb 25, 2026

Copy link
Copy Markdown
Contributor

This is moving from rusttype to ab_glyph as requested in #5.

While the code runs and tests pass, I've marked this as WIP, because running the main program will not output the same image as before.
Something seems to go wrong when cropping the image and I haven't yet found out where this problem comes from (in main.rs line 37 change y from 143 to 82 and it kinda works).

TODO:

  • Fix cropping issue
  • Update code example in README.md

@okin okin marked this pull request as draft February 25, 2026 11:16
@okin okin force-pushed the switch_to_ab_glyph branch from f2fedc6 to 476144f Compare February 25, 2026 11:17
okin added 2 commits February 25, 2026 12:20
The previously used rusttype is unmaintained.

With the switch we also bump the dependencies of image and imageproc,
because newer versions support ab_glyph better and made porting much
easier.

The port changes the API in some places.

The custom type Color is now an alias to Rgba<u8>.
This a user-facing change where users now have to submit appropriate types.

Image.text_size will return u32 instead of i32.

Image.add_custom_font will now take a ref of the loaded font file.

Fixes jeffersoncbd#5
@okin okin force-pushed the switch_to_ab_glyph branch from 476144f to 758f35e Compare February 25, 2026 11:20
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.

1 participant