Skip to content

Add some string comparision capabilities to TPixelFont#558

Open
Torwent wants to merge 1 commit intoVillavu:simba2000from
WaspScripts:TPixelFont
Open

Add some string comparision capabilities to TPixelFont#558
Torwent wants to merge 1 commit intoVillavu:simba2000from
WaspScripts:TPixelFont

Conversation

@Torwent
Copy link
Contributor

@Torwent Torwent commented Mar 10, 2026

Should be pretty straightforward but helps comparing/replacing characters with the TPixelFont glyphs in mind.

I wasn't sure what to use for the unique glyph signature and decided to go with a slightly modified @slackydev hashing function, feel free to pick something more suitable if this is to be merged.

I kind of wanted to also build what String.Similarity() does into this but it seemed too crazy and I'm not sure if it's worth the trouble as it can just be chained with the TPixelFont.ReplaceSameGlyph() I added in this.

I would like to ask however if there's a reason to not using the Chars ASCII value to index the glyphs?
I understand it would take a few more bytes but since there's only 255 characters max I don't really see it as a big deal and would make stuff like this much cheaper to do.

@Torwent
Copy link
Contributor Author

Torwent commented Mar 10, 2026

I also decided to make everything inline because in my head it has no downsides, IDK in practice

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