mlterm icon indicating copy to clipboard operation
mlterm copied to clipboard

Nepali ligatures not working

Open nirodhvana opened this issue 11 months ago • 23 comments

Nepali ligatures dont work properly even though they also use devnagari like hindi

the spacing is sometimes trash and ि ी dont work and the lines on top dont join up

Image

is there an option i need to compile it with? I can provide more info if you need.

this is the default build from apt I installed on mint

nirodhvana avatar Jan 31 '25 08:01 nirodhvana

I seem dumb rn dont I :)

but it works in konsole

Image

nirodhvana avatar Jan 31 '25 08:01 nirodhvana

Will you show me ~/.mlterm/main, ~/.mlterm/msg.log and what 'mlterm --version' outputs? What happens if you start mlterm with -otl option?

arakiken avatar Feb 01 '25 11:02 arakiken

@arakiken the version output is 3.9.0 no .mlterm/main and heres my r/unixporn with -otl option on left and the .mlterm/msg.log on the right

Image

:)

nirodhvana avatar Feb 01 '25 12:02 nirodhvana

@arakiken ive tried everything in the guide : https://github.com/arakiken/mlterm/blob/master/doc/en/README.indic

still cant get it to work. Nepali uses the same devanagari script that hindi uses, so it should work but it doesnt :(

also found this depressing article https://benizi.com/vim/devanagari/

nirodhvana avatar Feb 07 '25 13:02 nirodhvana

@arakiken is there some inherent difference between nepali and hindi even though they use the same script?

nirodhvana avatar Feb 08 '25 05:02 nirodhvana

Hmm... I think there is no difference between nepali and hindi in setting mlterm. Building mlterm with harfbuzz and start it with --otl option shows a following screen in my environment. Image

  1. Have you already tried mlterm 3.9.3 or git head?

  2. Does ./configure output a following line in buiding mlterm? OpenType Layout : yes (harfbuzz)

  3. Which font do you use to show devanagari?

arakiken avatar Feb 09 '25 06:02 arakiken

Hmm... I think there is no difference between nepali and hindi in setting mlterm. Building mlterm with harfbuzz and start it with --otl option shows a following screen in my environment. Image

  1. Have you already tried mlterm 3.9.3 or git head?
  2. Does ./configure output a following line in buiding mlterm? OpenType Layout : yes (harfbuzz)
  3. Which font do you use to show devanagari?
  1. I did compile 3.9.3

  2. Yes it does show:

Image

@arakiken

  1. It definetely seems to be the fonts causing the problem. I couldn't setup my [fonts] (https://github.com/nirodhvana/reservoir/blob/master/.local/share/fonts/nepali-fonts/fonts/nepali.ttf) because i couldnt understand the documentation :(

nirodhvana avatar Feb 09 '25 10:02 nirodhvana

nepali.ttf doesn't have any open type layout table for devanagari. mlterm depends on open type layout tables in otf fonts to render complex text layout languages such as devanagari.

ex.) NotoSansDevanagari $ fc-query NotoSansDevanagari-Medium.ttf ... capability: "otlayout:DFLT otlayout:dev2 otlayout:deva"(s)

Sorry but it is impossible for mlterm to show devanagari correctly with the use of nepali.ttf for now.

arakiken avatar Feb 09 '25 15:02 arakiken

nepali.ttf doesn't have any open type layout table for devanagari. mlterm depends on open type layout tables in otf fonts to render complex text layout languages such as devanagari.

ex.) NotoSansDevanagari $ fc-query NotoSansDevanagari-Medium.ttf ... capability: "otlayout:DFLT otlayout:dev2 otlayout:deva"(s)

Sorry but it is impossible for mlterm to show devanagari correctly with the use of nepali.ttf for now.

@arakiken is there anyway to add an opentype layout table for devnagari in the font ? Otherwise i can be down with the noto sans devnagari too. Dont think it's in the ubuntu repos tho.

nirodhvana avatar Feb 09 '25 15:02 nirodhvana

@arakiken Will this work too? Found it in void's repos. https://software.sil.org/annapurna/

the download page states something about opentype or smth https://software.sil.org/annapurna/download/

the github too https://github.com/silnrsi/font-annapurna

nirodhvana avatar Feb 09 '25 15:02 nirodhvana

I found a bug where glyphs were not drawn in the correct position with some fonts, such as annapurna you suggested. I fixed this bug. -> https://github.com/arakiken/mlterm/commit/f2c5024e3b215cb2b4e5f9a85d55e211e8451c30 If you use annapurna font, please rebuild mlterm. After this fix, mlterm shows devanagari as attached by following steps.

  1. Add "U+900-97f = Annapurna SIL" to ~/.mlterm/aafont.
  2. Start mlterm with --otl option.

Image

arakiken avatar Feb 11 '25 13:02 arakiken

I found a bug where glyphs were not drawn in the correct position with some fonts, such as annapurna you suggested. I fixed this bug. -> f2c5024 If you use annapurna font, please rebuild mlterm. After this fix, mlterm shows devanagari as attached by following steps.

  1. Add "U+900-97f = Annapurna SIL" to ~/.mlterm/aafont.
  2. Start mlterm with --otl option.

Image

Thank you for the work. I still cant seem to figure out how to setup fonts right. Do you have a guide for that? I wanna RTFM LOL

Also, will programs like vim also depend on mlterm or will i have some troble with fonts in vim too?

Also ;) does mlterm have this feature? think it might come in handy. https://github.com/kovidgoyal/kitty/issues/461

nirodhvana avatar Feb 12 '25 13:02 nirodhvana

I found a bug where glyphs were not drawn in the correct position with some fonts, such as annapurna you suggested. I fixed this bug. -> f2c5024 If you use annapurna font, please rebuild mlterm. After this fix, mlterm shows devanagari as attached by following steps.

  1. Add "U+900-97f = Annapurna SIL" to ~/.mlterm/aafont.
  2. Start mlterm with --otl option.

Image

I have this wierd issue with https://github.com/hchargois/gohufont where you can see that the characters sometimes mashed up:

Image

@arakiken ill see if that commit fixes it thanks.

nirodhvana avatar Feb 13 '25 13:02 nirodhvana

@arakiken seems the commit fixed it thank you also :) does mlterm have this feature? think it might come in handy. https://github.com/kovidgoyal/kitty/issues/461

nirodhvana avatar Feb 13 '25 14:02 nirodhvana

I have this wierd issue with https://github.com/hchargois/gohufont where you can see that the characters sometimes mashed up:

@arakiken ill see if that commit fixes it thanks.

If you use proportional fonts, try to use -V option.

arakiken avatar Feb 23 '25 01:02 arakiken

@arakiken seems the commit fixed it thank you also :) does mlterm have this feature? think it might come in handy. kovidgoyal/kitty#461

Supporting this feature would require a major overhaul. I'll consider it for the future.

arakiken avatar Feb 23 '25 01:02 arakiken

I have this wierd issue with https://github.com/hchargois/gohufont where you can see that the characters sometimes mashed up: @arakiken ill see if that commit fixes it thanks.

If you use proportional fonts, try to use -V option.

I dont know much about fonts. This is the one i'm using https://font.gohu.org do i need that option for it ?

nirodhvana avatar Feb 23 '25 16:02 nirodhvana

@arakiken seems the commit fixed it thank you also :) does mlterm have this feature? think it might come in handy. kovidgoyal/kitty#461

Supporting this feature would require a major overhaul. I'll consider it for the future.

It would be easier for editing scripts with lots of ligatures etc like devanagari

nirodhvana avatar Feb 23 '25 16:02 nirodhvana

I have this wierd issue with https://github.com/hchargois/gohufont where you can see that the characters sometimes mashed up: @arakiken ill see if that commit fixes it thanks.

If you use proportional fonts, try to use -V option.

I dont know much about fonts. This is the one i'm using https://font.gohu.org do i need that option for it ?

If mlterm correctly loads gohu font which is monospace, -V option is not necessary. I think that the font shown in the screenshot you uploaded is not gohu font but some kind of a proportional font which has ligature open type layout table. While mlterm draws glyphs in a propotional font forcibly as monospace, mlterm with -V option draws them natually, so I think that -V option improves a little. But the essential reason why some glyphs are mixed is because mlterm with --otl option processes text with the ligature table in the font. Anyway, if mlterm could load gohu font correctly, this would solve the problem.

arakiken avatar Feb 24 '25 14:02 arakiken

I have this wierd issue with https://github.com/hchargois/gohufont where you can see that the characters sometimes mashed up: @arakiken ill see if that commit fixes it thanks.

If you use proportional fonts, try to use -V option.

I dont know much about fonts. This is the one i'm using https://font.gohu.org do i need that option for it ?

If mlterm correctly loads gohu font which is monospace, -V option is not necessary. I think that the font shown in the screenshot you uploaded is not gohu font but some kind of a proportional font which has ligature open type layout table. While mlterm draws glyphs in a propotional font forcibly as monospace, mlterm with -V option draws them natually, so I think that -V option improves a little. But the essential reason why some glyphs are mixed is because mlterm with --otl option processes text with the ligature table in the font. Anyway, if mlterm could load gohu font correctly, this would solve the problem.

Mlterm does display gohu correctly and the font in the picture wasn't actually gohu and i found out later that my config was messed up

nirodhvana avatar Feb 24 '25 17:02 nirodhvana

@arakiken weird characters appear on the other side when typing in nvim and the letters stutter

Image

Image

Image

Sorry for poor image quality my monitor is broken so im using an old tv :)

update: only seems to happens when anti-aliased fonts are enabled

nirodhvana avatar Apr 01 '25 12:04 nirodhvana

@arakiken weird characters showup while using cat and editing nepali and ligatures also cutoff at weird parts

my config:https://github.com/nirodhvana/reservoir/tree/master/.mlterm

cat

Image

neovim

Image

nirodhvana avatar Apr 07 '25 06:04 nirodhvana

Hmm... I think there is no difference between nepali and hindi in setting mlterm. Building mlterm with harfbuzz and start it with --otl option shows a following screen in my environment. Image

  1. Have you already tried mlterm 3.9.3 or git head?
  2. Does ./configure output a following line in buiding mlterm? OpenType Layout : yes (harfbuzz)
  3. Which font do you use to show devanagari?

@arakiken Can you share your config? I cant get the font to look like the one in the picture at all

nirodhvana avatar Apr 08 '25 11:04 nirodhvana