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

diacritics alignment problems #228

Closed
kchibisov opened this issue Apr 30, 2020 · 10 comments
Closed

diacritics alignment problems #228

kchibisov opened this issue Apr 30, 2020 · 10 comments
Labels
unicode request Request for adding more symbols
Milestone

Comments

@kchibisov
Copy link

kchibisov commented Apr 30, 2020

version of the font: 1.0.6

tested on 1.0.5 and it was broken in +- the same way.

It seems like diacritics are still has alignment problems. The following file contains a good test case to check their alignment sample.txt. On the last lines of this file it's way more noticeable, since those chars are inside of the glyphs.

The issue could be observed in alacritty and Firefox 75 on linux. note, Alacritty doesn't perform font shaping, so diacritics weren't combined with anything else (noticeable on Fira Code example, since it renders them a bit better than Firefox)

In alacritty part of this file looks like this:

jetbrains-alacritty

In Firefox it looks like this(tested by simply pasting in https://godbolt.org/

jetbrains

On the other hand, Fira Code seems to render fine in the mentioned programs.

alacritty

fira-alacritty

Firefox

fira

@philippnurullin
Copy link
Member

This diacritics look looks it was auto generated from existing glyphs.
In your example the is generated from 2 separete glyphs on the go in editor. For example, there are two glyphs in sequence uni0061 (a) + uni0302 (circumflex). And by adjusting the placement of circumflex in its place this "auto" glyph can be generated like in your example. In JetBrains Mono this glyph is made like one â, so this test example is not representing the actual placement of the diaritics in JetBrains Mono.
This is a list of all diacritics symbols currently supported: ijÀÁÂÃÄÅÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞàáâãäåçèéêëìíîïðñòóôõöøùúûüýþÿĀāĂ㥹ĆćĈĉĊċČčĎďĐđĒēĔĕĖėĘęĚěĜĝĞğĠġĢģĤĥĦĨĩĪīĬĭĮįİĴĵĶķĹĺĻļĽľĿŀŁłŃńŅņŇňʼnŌōŎŏŐőŔŕŖŗŘřŚśŜŝŞşŠšŢţŤťŦŧŨũŪūŬŭŮůŰűŲųŴŵŶŷŸŹźŻżŽžƏƒƠơƯưǦǧǪǫǴǵǼǽǾǿȘșȚțЁЃЇЌЎЙйёѓіїјќўẀẁẂẃẄẅẠạẢảẤấẦầẨẩẪẫẬậẮắẰằẲẳẴẵẶặẸẹẺẻẼẽẾếỀềỂểỄễỆệỈỉỊịỌọỎỏỐốỒồỔổỖỗỘộỚớỜờỞởỠỡỢợỤụỦủỨứỪừỬửỮữỰựỲỳỴỵỶỷỸỹ

But, this approach to make diacritics is interesting. I will look at it. Do you know where this constructed diacritics is used?

@kchibisov
Copy link
Author

In your example the â is generated from 2 separete glyphs on the go in editor.

Hm, that's interested, but I know for sure that alacritty(terminal emulator) can't do that at all, it just asks FreeType to get glyph for exactly one char at the time and don't shape them at all. Could you elaborate on what editor is here, just curious? Are you talking about that they are separate from the glyphs and text editing program (e.g. Firefox) then combines them? If so, yes, they are separate from the glyphs and combined later, but naturally and not by editor, since such glyphs tend to have special metrics (negative offsets, etc), so it's font responsibility to position them properly. Some fonts have wrong metrics for them and you can see them separate, like DejaVu Sans Mono. e.g. alacritty/alacritty#2620 (comment)

But, this approach to make diacritics is interesting. I will look at it. Do you know where this constructed diacritics is used?

Idk, I feel like they just happen to be seen from time to time. We've seen them here alacritty/alacritty#1420 and alacritty/alacritty#2620

@philippnurullin
Copy link
Member

but I know for sure that alacritty(terminal emulator) can't do that at all

I think it can. The logic of this thing is that's just two glyphs, one after another. The diacritic mark have just negative spacing, so it can be placed correctly. This is possible in every text editor.
The problem is that examples in sample.txt are all like this. So it produces the fals results because instead reaching for correct glyphs it's trying to recreate them. I'm sure this technique is made on purpose but this needs to be explored further.

@kchibisov
Copy link
Author

kchibisov commented Apr 30, 2020

I think it can. The logic of this thing is that's just two glyphs, one after another. The diacritic mark have just negative spacing, so it can be placed correctly. This is possible in every text editor.

but naturally and not by editor, since such glyphs tend to have special metrics (negative offsets, etc), so it's font responsibility to position them properly.

Yeah, as I said. If font has wrong metrics for them, user is out of luck.

@philippnurullin philippnurullin added the unicode request Request for adding more symbols label May 6, 2020
philippnurullin added a commit that referenced this issue Oct 21, 2020
Major changes
— Added Greek alphabet #58
— Reworked diacritics #228
— Removed x-height increasing from hinting. Affects non Retina screens. #286 #265 #272 #262 #275
— A lot of tiding up of contours to meet Google Fonts criteria
Other updated and fixes
— Ligature for 0x (hexadecimal) prefix #98
— Lowered horizontal bar in Florin to make it more distinguishable form italic f #129
— Changes the 8 construction to make it more distinguishable from B and 0 #188
— Added Changelog #263
— Variable font correctly grouped in one family with Italics #270
— Reverted to previous construction of f #273
— Corrected OneNote line height #278
— Removed kerning pair #297
— Add Overline #298
— Increased difference between hyphen, en-dash, and em-dash #318
— Removed the "tail" in the italic a
@Mouvedia
Copy link

2.200 doesn't fix this issue in Alacritty. @philippnurullin please reopen.

@philippnurullin
Copy link
Member

Hi @Mouvedia . Please make sure that you removed the the old font from OS fist and please provide screenshots with problem. The exact copy of the code/text in editable format will be nice to.

@kchibisov
Copy link
Author

@philippnurullin I've rechecked this issue, and it seems like you've added some diacritics, however as far as I can see the left position for them is positive, thus they are rendered to the right of the glyph, however fonts like Hack/Fira Mono are using negative left for them, so they are placed naturally, also only certain diacritics were added and not all from the sample.txt

However JetBrains mono seems to have a good example of diacritics and it's \u{336}, which has left -10(for 10pt size) and looks the following.

picture

Unlike some other glyphs from the mentioned 'sample.txt' in the issue.

picture

For the test the font version was v2.210.

@philippnurullin philippnurullin added this to the v2.300 milestone Nov 16, 2020
philippnurullin added a commit that referenced this issue Dec 21, 2020
- Removed `.-` ligature #76
- Disabled ligatures for lookahead/lookbehind prefixes (regex) #126
- Added support for combined marks #228
- Added `∪` #244
- Added `➜`(U+279C), `✗`(U+2717), and `✓`(U+2713) #246
- Added `<<~` #291
- Added `‾` Overline #298
- Tuned Cyrillic `в` #335
- Increase BoxDraving. Top +100, bottom +100 #382
- Added `‿` `∁` `∎` `⊸` `⊎` `⨀` `⨆` `∩` `∶` `⊢` `⊤` `⊥` `⊛` `⊖` `⊗` `⊙` `⊕` `◦` `⋆` `ℚ` `ℤ` `slashshortcomb`
- Corrected placement of bar in italic `Đ`
- Polished Digits
@philippnurullin
Copy link
Member

@kchibisov Please test latest push. It took more time that expected, but all the mark that are currently in the font placed with negative LSB. Should work now.

@Mouvedia
Copy link

Mouvedia commented Dec 21, 2020

The ones that I care about are fixed. Thanks!

FYI here's a subset of the ones that aren't:

a̅b̅c̅
a̍b̍c̍
a̎b̎c̎
a̐b̐c̐
ȃb̑c̑
a̓b̓c̓
a̔b̔c̔
a̕b̕c̕
a̖b̖c̖
a̗b̗c̗
a̘b̘c̘
a̙b̙c̙
a̚b̚c̚
a̜b̜c̜
a̝b̝c̝
a̞b̞c̞
a̟b̟c̟
a̠b̠c̠
a̡b̡c̡
a̢b̢c̢
a̤b̤c̤
a̩b̩c̩
a̪b̪c̪
a̫b̫c̫
a̬b̬c̬
a̭b̭c̭
a̮b̮c̮
a̯b̯c̯
a̰b̰c̰
a̱ḇc̱
a̲b̲c̲
a̳b̳c̳
a̴b̴c̴
a̵b̵c̵
a̹b̹c̹
a̺b̺c̺
a̻b̻c̻
a̼b̼c̼
a̽b̽c̽
a̾b̾c̾
a̿b̿c̿
a̓b̓c̓
a͘b͘c͘
a͜b͜c͜
a͝b͝c͝
a͞b͞c͞
a͟b͟c͟
a͠b͠c͠
a͡b͡c͡
a͢b͢c͢

@philippnurullin
Copy link
Member

The JetBrains Mono is not supporting the all diacritics presented in the sample. All the diacritics it support should work fine. I'm not sure on the popularity of what's left, so i will wait for the request to add it.
Closing this issue because general problem is solved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
unicode request Request for adding more symbols
Projects
None yet
Development

No branches or pull requests

3 participants