-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Combine Pixels Into Polygons #98
Combine Pixels Into Polygons #98
Conversation
Yeah, to handle holes, i basically put a tiny cut in the outer polygon, then splice the hole in. There may be better solution though. The hole polygonizer algorithm is still there, just need to rework how to put it back in. EDIT: Meanwhile i'll fix colinear line in the splicing algorithm. |
As it turns out, to add holes, just emit the inner polygon (RIP colinear remover).
Okay i fixed it. Turns out, i just need to emit the inner polygon to be recognized as holes. Fingers crossed that font renderers can handle that. |
Huh, i tested it and it seems like some weird interaction with mutating iterator variable. I'll push the fix soon. |
I think you should add a license notice similar to other files, but otherwise it looks good to me. |
My apologies for being a little off-topic, but I am super fascinated by this.
My question is how exactly the length is figured out, as the output of I would be super happy to know more about this if you don't mind. You can use email in my profile if you would rather not explain here. Thanks! |
As far as my knowledge goes, there seem to be no one else that do it the same way. I'll explain what the algorithm does:
The cell data is a bitflag with values as follows:
The filled bit is obvious. The wall bits are used to find inner boundaries that has not been found (if it should have wall but isn't set). I don't know what you mean by length, i don't use length in the algorithm, only direction of the turtle is considered. And that problem with ф is apparently Python does not like mutating iterator variable while it is iterating. I never experienced this issue until now, but currently i restore the inner value every time the inner polygon generation is done. Maybe it's my bug, but so far that fixes it. |
Apologies for the delay in reviewing this, had the flu, not fun. Thanks @Ciubix8513 for reviewing it in the meantime and discovering those bugs! |
FYI I noticed a detail when installing new version of the font, I believe these margin alignments are (leftMargin from 4403411) are no longer applied. P.S. I also extended symbols with european-nonlatin set: https://github.com/dantaeusb-mc/Minefont/blob/main/src/characters.json, but it's auto-generated, and I'm still working on it. I want to get non-monospaced version too. |
Oh yeah, i didn't see that left margin can be non-integer. I just assumed it is and shift the entire image. I think i did the same with descent and diacritic space too. Oh well, that could be fixed later. Thanks anyway for accepting my PR. |
This PR fixes #88 by combining pixels into polygons.