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

Extend characters with European non-latin set #105

Merged
merged 4 commits into from
Mar 22, 2023

Conversation

dantaeusb
Copy link
Contributor

This pull request contains all implemented european non-latin letters, without margins.

While definitions seem correct to me, with the current shape implementation, there are few issues to fix alongside:

1. Characters longer than 5px are overlapping other characters.

Examples with Georgian and Armenian scripts:
Screenshot 2023-02-05 at 23 55 00
Screenshot 2023-02-05 at 23 55 07
Screenshot 2023-02-05 at 23 55 03
Screenshot 2023-02-05 at 23 55 09

2. Descent pixels, which are lower than 7px border, seem to be cut off, even with correct descent parameter:

kart-issue

@dantaeusb
Copy link
Contributor Author

I believe it addresses the #41, #75. Though for Hebrew, some adjustments might be useful.

A couple of letters seem to be off, for example ע

Screenshot 2023-02-06 at 00 15 06

@dantaeusb
Copy link
Contributor Author

Also, Cyrillic ц is misaligned, missing descent: 1

Screenshot 2023-02-06 at 01 30 40

@dantaeusb
Copy link
Contributor Author

dantaeusb commented Feb 6, 2023

Results I was able to achieve on non-monospaced font (all webkit, macOS Chrome):

With smoothing, 16px
Screenshot 2023-02-06 at 03 44 04

No smoothing, 16px
Screenshot 2023-02-06 at 03 44 13

No smoothing, 8px (original size)
Screenshot 2023-02-06 at 03 44 30

Some notable details:

Using bearings instead of extra pixel in fixed width:

monocraft[character["name"]].left_side_bearing = math.floor(PIXEL_SIZE / 2)
monocraft[character["name"]].right_side_bearing = math.floor(PIXEL_SIZE / 2)

Which works surprisingly well. Though, probably won't help to fit more into long letters. But margins could.

The cut-off of the descent pixels could be either a macOS preview bug, or miscalculated size.
For size to work properly, I found those parameters to work the best:

monocraft.design_size = 8
monocraft.em = math.floor(PIXEL_SIZE * 7.75)

UPD: I think it needs further tweaking. I used 8 as a “design size”, as I thought it's the tallest character, but with diacritics I believe it could reach as much as 12px (LATIN CAPITAL LETTER A WITH BREVE AND DOT BELOW). Tweaking greatly improves sharpness with WebKit AA, but not much with JetBrains AA.

UPD2: Apparently, those settings are working good only in macOS Webkit renderer. As I find macOS users who would like to render this font in smallest size without anti-aliasing rare, I don't think those settings should be considered.

@IdreesInc
Copy link
Owner

Wow, this is insane work, thank you for adding all of these characters! Due to the sheer number of characters added, I'll need a bit of time to review this before merging it in. Especially since we are about to release #112 which might change the appearance of certain characters.
Thanks again for this contribution and the accompanying notes!

@IdreesInc IdreesInc changed the base branch from main to v4-beta March 22, 2023 22:33
@IdreesInc
Copy link
Owner

IdreesInc commented Mar 22, 2023

Coming back to this, once again amazed at the number of glyphs added to the glyphset. I've looked through them from an english-speaking perspective and see no obvious bugs, but I am going to release this as a "beta" for a few days and see if anyone sees anything I might have missed. Thank you once again for the work you have put into this, it is very much appreciated.

@IdreesInc IdreesInc merged commit eced150 into IdreesInc:v4-beta Mar 22, 2023
@bilguun0203 bilguun0203 mentioned this pull request Mar 23, 2023
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