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

Not able to Compile with the font forge and the ttf file you provided is corrupt #11

Open
rstar24 opened this issue Aug 16, 2023 · 21 comments

Comments

@rstar24
Copy link

rstar24 commented Aug 16, 2023

.ttf file you provided is corrupt since few letter of devnagri is not mapped correctly to their UTF code and I don't understand even after using the file you provided I am not being able to correctly display the glyphs correctly.

@o-sdn-o
Copy link
Collaborator

o-sdn-o commented Aug 16, 2023

Could you please clarify in which application and operating system you are experimenting with .ttf font, and which code points are broken?

I created this font to see if it was possible to create a monospace font for scripts like Devanagari for text/terminal console which is cell-based. In other words, this font is proof of concept. The source of this font can only be compiled with FontForge Monotty Edition.

@rstar24
Copy link
Author

rstar24 commented Aug 16, 2023 via email

@o-sdn-o
Copy link
Collaborator

o-sdn-o commented Aug 16, 2023

Thank you for your interest!

The main problem here is related to terminals (deva mono fonts are the second). All terminals process characters at the level of codepoints, and for the correct display of Devanagari it is necessary to work at the level of grapheme clusters. Moreover, it is necessary to cut the images of these grapheme clusters into halves for placement in cells (the terminal is a cell-based environment) and operate with these fragments. Terminal developers do not want to deal with such complexities. For example, even hieroglyphs, which usually occupy two cells, they cannot be divided into halves (however it supported somehow), but here Devanagari syllables, which occupy four or more cells - terminal developers think it is overkill. The terminal I'm making - vtm - will support this and this font is just for that.

Unfortunately, at the moment, vtm does not yet have a graphical subsystem and there is no way to test this font yet.

As for FontForge Monotty, I compiled it on Ubuntu, and I can try it later on Fedora.

@o-sdn-o
Copy link
Collaborator

o-sdn-o commented Aug 19, 2023

Hi! The following commands are required to compile FontForge Monotty Edition on a Fedora 38 system. Run it in a terminal.

# Install dependencies
sudo yum install cmake gcc ninja-build gcc-c++ freetype-devel gettext libxml2-devel gtk3-devel python3-devel libspiro-devel libuninameslist-devel 

# Clone sources
cd ~
git clone https://github.com/monotty/fonts.git
git clone https://github.com/monotty/fontforge.git

# Build FontForge
cd fontforge
mkdir build
cd build
cmake -GNinja ..
ninja
ninja install

# Run FontForge
fontforge

Open the file monotty-dev2.sfd and you will see the following layout

image

@rstar24
Copy link
Author

rstar24 commented Aug 20, 2023 via email

@o-sdn-o
Copy link
Collaborator

o-sdn-o commented Aug 20, 2023

See this
[image: Screenshot from 2023-08-20 11-11-33.png]

Image link is broken. It's just only the text: [image: Screenshot from 2023-08-20 11-11-33.png].

@rstar24
Copy link
Author

rstar24 commented Aug 22, 2023 via email

@o-sdn-o
Copy link
Collaborator

o-sdn-o commented Aug 22, 2023

No images again.

@rstar24
Copy link
Author

rstar24 commented Aug 23, 2023

Screenshot from 2023-08-20 10-50-45
Screenshot from 2023-08-20 11-00-44
Screenshot from 2023-08-20 11-11-33
"May be I encountered some bug"

@o-sdn-o
Copy link
Collaborator

o-sdn-o commented Aug 23, 2023

All terminals I know of operate only with Unicode codepoints when displaying text. As far as I know, this is unacceptable for Devanagari writing, in which the codepoints that make up a syllable must be fused in a grapheme cluster and output as a monolithic wide glyph, e.g. three-cell wide glyph:

SGR-CFA-Indic

Currently, in terminals, each code point is displayed in isolation from its neighbors, and the size of the glyph is additionally adjusted to the cell size, which breaks shirorekha. The only way to test this font is to apply it in a WYSIWYG (what you see is what you get) text editor like Write from LibreOffice, or Word from MS Office. These programs, unlike terminals, perform correct grapheme clustering and display correct fused glyphs (six codepoints: "र​्ल​्क​ि" -> two-cell wide glyph "र्ल्कि"):

indic_syllable-i9

The example that I have in the description of the font was made using a WYSIWYG editor, not a terminal emulator. And my task now is to make it possible to display the Devanagari script in my terminal. If I manage to do this, then perhaps other terminal developers will pick up this idea, including the kitty, VTE and others.

@o-sdn-o
Copy link
Collaborator

o-sdn-o commented Aug 23, 2023

The difference between proportional and fixed-pitch rendering of glyphs

text sample (Hindi):
अनुच्छेद १.
सभी मनुष्यों को गौरव और अधिकारों के मामले में जन्मजात स्वतन्त्रता और समानता प्राप्त है ।
उन्हें बुद्धि और अन्तरात्मा की देन प्राप्त है और परस्पर उन्हें भाईचारे के भाव से बर्ताव करना चाहिए ।

colors: proportional font is marked in yellow, fixed-pitch in green, wide clusters are highlighted in tone

In GUI text editor (extra points over shirorekha for clarity):
image

Terminal window from future (not implemented yet):
image

# cat ./devanagari-mono.sh
#! /bin/bash
echo -e '

 अनुच्छेद १.
 सभी मनुष्यों को गौरव और अधिकारों के मामले में
 जन्मजात स्वतन्त्रता और समानता प्राप्त है ।
 उन्हें बुद्धि और अन्तरात्मा की देन प्राप्त है और
 परस्पर उन्हें भाईचारे के भाव से बर्ताव करना चाहिए ।
'

@o-sdn-o
Copy link
Collaborator

o-sdn-o commented Aug 23, 2023

I have a big question for native speakers. How acceptable is this distortion of the Devanagari glyphs? (I mean fitting to the terminal cell grid on the "Terminal window from future" screenshot - some glyphs have to be stretched a lot, and some have to be squeezed a lot)

@rstar24
Copy link
Author

rstar24 commented Aug 23, 2023

I am a native speaker of hindi. I have to admit some times it is very easier for me to write in Enlgish rather in hindi for reason you stated above the graphem cluster making in hindi is one of very features of this language. As you showed here
(six codepoints: "र​्ल​्क​ि" -> two-cell wide glyph "र्ल्कि" if translated into English this same glyph would be pronounced as "ralakee" almost twice more this one the reason one may love this script or hate it, this is done because the early sanskrit text used very large words as

कुलक्षये प्रणश्यन्ति कुलधर्माः सनातनाः।
धर्मे नष्टे कुलं कृत्स्नमधर्मोऽभिभवत्युत
(Bhagwat Geeta Chapter 1 Slok 40)
observe the last word it would become very difficult to read if we don't use the graphem clustering.

@rstar24
Copy link
Author

rstar24 commented Aug 23, 2023

I am interested in your project because I want to get this like result
screenshot
This guy has done some how for Mandarin I want to implement same for the Dev Nagri

@o-sdn-o
Copy link
Collaborator

o-sdn-o commented Aug 23, 2023

CJK (Chinese, Japanese, Korean) scripts almost never use composite (more than one codepoint per glyph) grapheme clusters. They have one hieroglyph corresponds to one codepoint, so it is fully supported by terminals.

@rstar24
Copy link
Author

rstar24 commented Aug 24, 2023

Yes, you are absolutely right. I have few friends of mine who are not so good in the command line or have a basic understanding regarding the computer.
My internet is making Indians feel like home when learning some advanced stuff and I would also say it also has an aesthetic appeal to it. Using Hindi in terminal while teaching students Linux may spark interest among them to dig more into the rabbit hole.

@nazaradeh
Copy link

I am not a native speaker, but the distortion is not the biggest deal for me. I view it as something that's expected to get a mono spaced font. The matra can also maybe just be extended to be longer in order to fit a 3 to 4 character-long ligature.

Also, is there any update/plans to add Bengali to the fonts? I see it listed as a to-do, but I also see no commits in a year, so maybe the creators don't have the time anymore. There are no good mono spaced Bangla fonts out there unfortunately.

@o-sdn-o o-sdn-o closed this as completed Aug 29, 2023
@o-sdn-o o-sdn-o reopened this Aug 29, 2023
@o-sdn-o
Copy link
Collaborator

o-sdn-o commented Aug 29, 2023

I mistakenly clicked to close the issue 😉.

Thanks for your feedback. The creation of fonts for the rest of the scripts in the list is pending the creation of a terminal capable of displaying them. Even though I've been working full-time seven days a week on my terminal project for five years now, it could take a couple more years and I'm looking forward to it.

@o-sdn-o
Copy link
Collaborator

o-sdn-o commented Aug 29, 2023

I was a little imprecise, my project is not a terminal, but a textual desktop environment vtm. The terminal is just one of the accessories.

@rstar24
Copy link
Author

rstar24 commented Sep 1, 2023

I mistakenly clicked to close the issue 😉.

Thanks for your feedback. The creation of fonts for the rest of the scripts in the list is pending the creation of a terminal capable of displaying them. Even though I've been working full-time seven days a week on my terminal project for five years now, it could take a couple more years and I'm looking forward to it.

It is none of my business but Can you shed some light on to the value of why are you going through such huge length to make a desktop environment.Because I am seeing the amount of dedication you have given to it is really big.

@o-sdn-o
Copy link
Collaborator

o-sdn-o commented Sep 1, 2023

The ultimate goal is to create a tool (Desktopio Framework documentation placeholder) for easy and fast creation of cross-platform desktop applications. Since the graphic subsystems are very different on different platforms, I decided to first do all this stuff only for textual consoles/terminals. Despite the fact that the text mode on different platforms (windows/unix) is very different, it is still easier to create and debug cross-platform apps. My textual desktop environment is a host for my (DirectVT) applications like a graphical desktop environment for graphical/GUI applications. When I implement a GUI-frontend for my applications, then my environment will automatically become a graphical desktop environment. Moreover, applications created using desktopio framework will be able to run both in a text environment such as a terminal, and in any graphical environment on any platform.

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

No branches or pull requests

3 participants