Skip to content
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

Adds Bold and Italic Variants #128

Open
wants to merge 7 commits into
base: v4
Choose a base branch
from

Conversation

Dheatly23
Copy link
Contributor

@Dheatly23 Dheatly23 commented Jun 19, 2023

Implements #127. Still needs to fix lag somehow. And maybe package all variants in a single file?

Example:
(size: 10 pt)
(in order: Regular, Italic, Bold, Bold Italic):
Example

@Ciubix8513
Copy link
Contributor

Font generation can be really slow, especially now with continuous ligatures, and this will slow it down 3x, if I understand the code. Maybe it would be a good idea to separate each variant generation into it's own thread? So that the slow down is not that bad.

I don't have much experience with python, but form what I found it seems to be relatively easy

@Dheatly23
Copy link
Contributor Author

It gets a bit better with manually transforming bold glyph. But now there is really nasty segfault which i can't fix. I've commented out the offending line for now.

@LevitatingBusinessMan
Copy link

Very cool! What are the current issues that still need to be fixed?

@Dheatly23
Copy link
Contributor Author

Boldness needs to be ajdusted, i'm still trying to find a middle point. And i didn't test for all character, some might gets unreadable with bold. Also i don't know if putting all fonts into .ttc is a good move, maybe some OS does not support it? Lastly generation time is getting even longer, but it can be deferred for another time.

@Dheatly23 Dheatly23 marked this pull request as ready for review July 13, 2023 04:15
@Dheatly23 Dheatly23 changed the title Adds Bold and Italic Variant Adds Bold and Italic Variants Jul 13, 2023
@LevitatingBusinessMan
Copy link

I've tried it out. For my usecase, in the terminal, the bold might be too thick.

Which conflicts with @SirMishaa's opinion who thinks it needs to be thicker.

@Dheatly23
Copy link
Contributor Author

Dheatly23 commented Aug 27, 2023

I can make it multiple level of boldness/thinness. Trouble is, build time multiplies with each new variant. Another thing is i haven't had any algorithm for thinning, particularly with diagonals.

@LevitatingBusinessMan
Copy link

I don't think build time is that much of an issue. My laptop compiles your branch in 30 seconds, and most people download the font pre-built. I am curious what @IdreesInc's opinion is on that.

@Ciubix8513
Copy link
Contributor

I personally agree, while long build times are annoying when you're trying to quickly iterate on a glyph(s) for most people it's not an issue. Maybe add a flag to disable generation of additional fonts, to allow to iterate faster? if that's the concern.

@IdreesInc IdreesInc self-assigned this Jan 7, 2024
@IdreesInc
Copy link
Owner

IdreesInc commented Jan 7, 2024

I don't think build time is that much of an issue. My laptop compiles your branch in 30 seconds, and most people download the font pre-built. I am curious what @IdreesInc's opinion is on that.

Look, if the font you use doesn't take a few days to generate, is it even a real font?

Update: Generates relatively quickly on my modern machine and with the new flags allowing people to skip generation of certain variants it should be fine.

@IdreesInc
Copy link
Owner

Wow, this is fantastic, thanks @Dheatly23 for adding this in! Apologies for the delay in reviewing it, been working on many new projects at once and haven't had the time to review new features in stable projects until now.
The new weights look great, though the very bold and very light ones are hard to read on my machine (as expected). I've noticed that the font looks different based on the whether the user is on Windows or Mac due to the font rendering, so having new weights would likely reduce a lot of the complaints Monocraft receives. My only question is why do we need italic variants? At least on my Mac, the font is italicized automatically, though maybe this doesn't occur on other machines?

@IdreesInc IdreesInc changed the base branch from main to v4 January 7, 2024 18:55
@Dheatly23
Copy link
Contributor Author

Thanks for the review!

I made a few tweaks with the polygonizer algorithm to support bold/thin, so there may be some bugs. And i'm still not happy with thinning algorithm (example: how to thin across corner?), but for now it's not too bad. One optimization (removing segmentation) significantly speeds up the code.

About the italic, some font renderer apparently can't automatically italicize fonts. So i suppose adding separate italic file would fix that.

With boldness of black variant, i reduce it a bit just now. You can see it here (8 pts, Windows 10):
Black Before After
I'm worried it's a bit too close to other variants, so feedback is much appreciated!

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.

None yet

4 participants