tonsky / FiraCode

Free monospaced font with programming ligatures
SIL Open Font License 1.1
76.78k stars 3.09k forks source link

Add markers for special Unicode characters #1165

Open vpetzel opened 3 years ago

vpetzel commented 3 years ago

Hello, I suggest using some sort of marker for special Unicode chars such as thinspaces and other non standard spaces, zero width joiners and such things. I think in a coding font every char should be visible (so you know that they are there). I guess even a code such as ZWNJ for x200c for example would work.

Regards, Valentin

RubenVerg commented 3 years ago

Wait, no? If I have a zwnj it's because I need to not join and for it to be zero width

If you have a strange use-case when you need to see them, there surely are extensions for your favorite IDEs.

Get Outlook for Androidhttps://aka.ms/ghei36


From: Valentin Petzel notifications@github.com Sent: Monday, December 7, 2020 12:16:42 AM To: tonsky/FiraCode FiraCode@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Subject: [tonsky/FiraCode] Add markers for special Unicode characters (#1165)

Hello, I suggest using some sort of marker for special Unicode chars such as thinspaces and other non standard spaces, zero width joiners and such things. I think in a coding font every char should be visible (so you know that they are there). I guess even a code such as ZWNJ for x200c for example would work.

Regards, Valentin

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://nam01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftonsky%2FFiraCode%2Fissues%2F1165&data=04%7C01%7C%7Cdbc917ffdf2943fc959b08d89a3cfdfe%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637428934028296392%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=1y%2F1JKnRLsh18bA2Yf3Hnn8sWwP%2BrPhPm5a63IS%2FOnE%3D&reserved=0, or unsubscribehttps://nam01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAMRJI3B4T2ZIJX6KSBIWKNDSTQGFVANCNFSM4UPVQE4A&data=04%7C01%7C%7Cdbc917ffdf2943fc959b08d89a3cfdfe%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637428934028306378%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=qtc1MswMkhA8jEfWjiXPzo3MZGfw%2Bdb2IBkdgZvlkiM%3D&reserved=0.

vpetzel commented 3 years ago

Not really. As I understand it, this font should be tuned for Code, and usually Code is not what you want, but a representation of what you want. Usually you want a zwnj for output and Typography, but not in Code. But the Code should be able to give all informations about what’s there, and should definitely not have any invisible characters. Source code should always be WYSIWYM, not WYSIWYG.

We could for example just use an opentype character variation to have such characters visible on demand.

alexeyten commented 3 years ago

Nice idea. Actually, long time ago I patched some fonts to show NBSP as underline with small letters sp under it. And em-dash/en-dash with letters m and n over dash.

RubenVerg commented 3 years ago

Generally so, but some characters are specially defined as being invisible and "control", would you like to see "LF" instead of a newline? Also lol am I the only one using Fira Code for UI?

Get Outlook for Androidhttps://aka.ms/ghei36


From: Valentin Petzel notifications@github.com Sent: Monday, December 7, 2020 10:23:06 AM To: tonsky/FiraCode FiraCode@noreply.github.com Cc: Ruben Vergani RubenVerg@outlook.com; Comment comment@noreply.github.com Subject: Re: [tonsky/FiraCode] Add markers for special Unicode characters (#1165)

Not really. As I understand it, this font should be tuned for Code, and usually Code is not what you want, but a representation of what you want. Usually you want a zwnj for output and Typography, but not in Code. But the Code should be able to give all informations about what’s there, and should definitely not have any invisible characters. Source code should always be WYSIWYM, not WYSIWYG.

We could for example just use an opentype character variation to have such characters visible on demand.

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftonsky%2FFiraCode%2Fissues%2F1165%23issuecomment-739790389&data=04%7C01%7C%7Ca2314be153a04d6329b908d89a91b51f%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637429297877407573%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=yXOCFTRpljVWMHqzpnqCsJ19T3OpiMY1OKtZHP42R%2FI%3D&reserved=0, or unsubscribehttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAMRJI3AYAM6JXSE2DBUKYC3STSNHVANCNFSM4UPVQE4A&data=04%7C01%7C%7Ca2314be153a04d6329b908d89a91b51f%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637429297877407573%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=8YBqAH%2BX%2FonFhowrQL6kjat4MdhibQ5hwewORFhvUUQ%3D&reserved=0.

RubenVerg commented 3 years ago

No what? How can you work with an em dash not looking like a dash, but like a strange underlined small M?

Get Outlook for Androidhttps://aka.ms/ghei36


From: Ruben Vergani RubenVerg@outlook.com Sent: Monday, December 7, 2020 10:48:38 AM To: tonsky/FiraCode FiraCode@noreply.github.com; tonsky/FiraCode reply@reply.github.com Cc: Comment comment@noreply.github.com Subject: Re: [tonsky/FiraCode] Add markers for special Unicode characters (#1165)

Generally so, but some characters are specially defined as being invisible and "control", would you like to see "LF" instead of a newline? Also lol am I the only one using Fira Code for UI?

Get Outlook for Androidhttps://aka.ms/ghei36


From: Valentin Petzel notifications@github.com Sent: Monday, December 7, 2020 10:23:06 AM To: tonsky/FiraCode FiraCode@noreply.github.com Cc: Ruben Vergani RubenVerg@outlook.com; Comment comment@noreply.github.com Subject: Re: [tonsky/FiraCode] Add markers for special Unicode characters (#1165)

Not really. As I understand it, this font should be tuned for Code, and usually Code is not what you want, but a representation of what you want. Usually you want a zwnj for output and Typography, but not in Code. But the Code should be able to give all informations about what’s there, and should definitely not have any invisible characters. Source code should always be WYSIWYM, not WYSIWYG.

We could for example just use an opentype character variation to have such characters visible on demand.

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftonsky%2FFiraCode%2Fissues%2F1165%23issuecomment-739790389&data=04%7C01%7C%7Ca2314be153a04d6329b908d89a91b51f%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637429297877407573%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=yXOCFTRpljVWMHqzpnqCsJ19T3OpiMY1OKtZHP42R%2FI%3D&reserved=0, or unsubscribehttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAMRJI3AYAM6JXSE2DBUKYC3STSNHVANCNFSM4UPVQE4A&data=04%7C01%7C%7Ca2314be153a04d6329b908d89a91b51f%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637429297877407573%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=8YBqAH%2BX%2FonFhowrQL6kjat4MdhibQ5hwewORFhvUUQ%3D&reserved=0.

vpetzel commented 3 years ago

Generally so, but some characters are specially defined as being invisible and "control", would you like to see "LF" instead of a newline? Also lol am I the only one using Fira Code for UI? Get Outlook for Androidhttps://aka.ms/ghei36 ____ From: Valentin Petzel notifications@github.com Sent: Monday, December 7, 2020 10:23:06 AM To: tonsky/FiraCode FiraCode@noreply.github.com Cc: Ruben Vergani RubenVerg@outlook.com; Comment comment@noreply.github.com Subject: Re: [tonsky/FiraCode] Add markers for special Unicode characters (#1165) Not really. As I understand it, this font should be tuned for Code, and usually Code is not what you want, but a representation of what you want. Usually you want a zwnj for output and Typography, but not in Code. But the Code should be able to give all informations about what’s there, and should definitely not have any invisible characters. Source code should always be WYSIWYM, not WYSIWYG. We could for example just use an opentype character variation to have such characters visible on demand. — You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftonsky%2FFiraCode%2Fissues%2F1165%23issuecomment-739790389&data=04%7C01%7C%7Ca2314be153a04d6329b908d89a91b51f%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637429297877407573%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=yXOCFTRpljVWMHqzpnqCsJ19T3OpiMY1OKtZHP42R%2FI%3D&reserved=0, or unsubscribehttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAMRJI3AYAM6JXSE2DBUKYC3STSNHVANCNFSM4UPVQE4A&data=04%7C01%7C%7Ca2314be153a04d6329b908d89a91b51f%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637429297877407573%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=8YBqAH%2BX%2FonFhowrQL6kjat4MdhibQ5hwewORFhvUUQ%3D&reserved=0.

But you do see LF in the form of a new line. The thing is: most control characters have absolutely no reason to appear in source code unless you want to specify that particular character. And in these cases it is useful for the characters to be actually seen, so you know they are there. E.g. let’s say im writing a text using a text file based processor, I’d want to prevent the ff-Ligature in ”Aufführungspraxis“ by adding a zwnj in between, making it ”Auf‌führungspraxis“. This will look exactly the same in a Text Editor, so it is almost impossible to keep track of where these things are. If we had something like ”Auf~führungspraxis“ where ~ is a placeholder for some sort of marking this would be much easier to keep track of. Or let’s say you want to have something like ”7. 12. 2020“. Here you would want thinspaces in between, so ”7. 12. 2020“. In a standard monospaced font there is absolutely no optical distinction between these two, making it again very hard to keep track of such things.

I don’t know what benefits FiraCode should have over Fira Mono for UI, but as I said, simply making use of opentype character variations will enable us to have both on demand.

RubenVerg commented 3 years ago

The benefits are ligatures, obviously

Get Outlook for Androidhttps://aka.ms/ghei36


From: Valentin Petzel notifications@github.com Sent: Monday, December 7, 2020 11:38:55 AM To: tonsky/FiraCode FiraCode@noreply.github.com Cc: Ruben Vergani RubenVerg@outlook.com; Comment comment@noreply.github.com Subject: Re: [tonsky/FiraCode] Add markers for special Unicode characters (#1165)

Generally so, but some characters are specially defined as being invisible and "control", would you like to see "LF" instead of a newline? Also lol am I the only one using Fira Code for UI? Get Outlook for Androidhttps://aka.ms/ghei36https://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Faka.ms%2Fghei36&data=04%7C01%7C%7Cb9cc76ed9e204592bdce08d89a9c4d35%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637429343381913475%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=HYfpqtrxMEyEwTltp5s%2FHKIqb0qKv9ecy3tCfr6RPx4%3D&reserved=0____ From: Valentin Petzel notifications@github.commailto:notifications@github.com Sent: Monday, December 7, 2020 10:23:06 AM To: tonsky/FiraCode FiraCode@noreply.github.commailto:FiraCode@noreply.github.com Cc: Ruben Vergani RubenVerg@outlook.commailto:RubenVerg@outlook.com; Comment comment@noreply.github.commailto:comment@noreply.github.com Subject: Re: [tonsky/FiraCode] Add markers for special Unicode characters (#1165https://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftonsky%2FFiraCode%2Fissues%2F1165&data=04%7C01%7C%7Cb9cc76ed9e204592bdce08d89a9c4d35%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637429343381923458%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=n8pfqyWHLdp7JlECHrTdtuyrtvCt1UmsQyevd7RNTHQ%3D&reserved=0) Not really. As I understand it, this font should be tuned for Code, and usually Code is not what you want, but a representation of what you want. Usually you want a zwnj for output and Typography, but not in Code. But the Code should be able to give all informations about what’s there, and should definitely not have any invisible characters. Source code should always be WYSIWYM, not WYSIWYG. We could for example just use an opentype character variation to have such characters visible on demand. — You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftonsky%2FFiraCode%2Fissues%2F1165%23issuecomment-739790389&data=04%7C01%7C%7Ca2314be153a04d6329b908d89a91b51f%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637429297877407573%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=yXOCFTRpljVWMHqzpnqCsJ19T3OpiMY1OKtZHP42R%2FI%3D&reserved=0https://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftonsky%2FFiraCode%2Fissues%2F1165%23issuecomment-739790389&data=04%7C01%7C%7Cb9cc76ed9e204592bdce08d89a9c4d35%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637429343381933441%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=HauZHIUHZRV4tHDP8gxrwf6PSFRcYj8zJHD6Tdndo9I%3D&reserved=0, or unsubscribehttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAMRJI3AYAM6JXSE2DBUKYC3STSNHVANCNFSM4UPVQE4A&data=04%7C01%7C%7Ca2314be153a04d6329b908d89a91b51f%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637429297877407573%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=8YBqAH%2BX%2FonFhowrQL6kjat4MdhibQ5hwewORFhvUUQ%3D&reserved=0https://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAMRJI3AYAM6JXSE2DBUKYC3STSNHVANCNFSM4UPVQE4A&data=04%7C01%7C%7Cb9cc76ed9e204592bdce08d89a9c4d35%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637429343381943426%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=WPuBpKsYctyGlzObYyrAGJNXQbTQylY9Lki8DyRQZAc%3D&reserved=0.

But you do see LF in the form of a new line. The thing is: most control characters have absolutely no reason to appear in source code unless you want to specify that particular character. And in these cases it is useful for the characters to be actually seen, so you know they are there. E.g. let’s say im writing a text using a text file based processor, I’d want to prevent the ff-Ligature in ”Aufführungspraxis“ by adding a zwnj in between, making it ”Auf‌führungspraxis“. This will look exactly the same in a Text Editor, so it is almost impossible to keep track of where these things are. If we had something like ”Auf~führungspraxis“ where ~ is a placeholder for some sort of marking this would be much easier to keep track of. Or let’s say you want to have something like ”7. 12. 2020“. Here you would want thinspaces in between, so ”7. 12. 2020“. In a standard monospaced font there is absolutely no optical distinction between these two, making it again very hard to keep track of such things.

I don’t know what benefits FiraCode should have over Fira Mono for UI, but as I said, simply making use of opentype character variations will enable us to have both on demand.

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftonsky%2FFiraCode%2Fissues%2F1165%23issuecomment-739833012&data=04%7C01%7C%7Cb9cc76ed9e204592bdce08d89a9c4d35%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637429343381958395%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=mJ4SALrhqpkqGX4cidFfpsLjTBVjBRagW9srp1n26pY%3D&reserved=0, or unsubscribehttps://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAMRJI3AMSC5HHNEHF4522K3STSWD7ANCNFSM4UPVQE4A&data=04%7C01%7C%7Cb9cc76ed9e204592bdce08d89a9c4d35%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637429343381968378%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=uXvxxCGiRVbg6HU4GAwuJ4oRJTKMozXb5LpQO0eX25w%3D&reserved=0.

tonsky commented 3 years ago

I suspect rendering ZWNJ might break e.g. emoji

vpetzel commented 3 years ago

I suspect rendering ZWNJ might break e.g. emoji

I don’t think it would. An emoji ligature does not require a zwnj, generally you’d only need the zwnj to prevent the emoji ligature from happening. But I think control characters like zwnj require software support, as software will usually not print these characters.

RubenVerg commented 3 years ago

I suppose they meant rendering ZWJ would break


Da: Valentin Petzel notifications@github.com Inviato: lunedì 7 dicembre 2020 15:14 A: tonsky/FiraCode FiraCode@noreply.github.com Cc: Ruben Vergani RubenVerg@outlook.com; Comment comment@noreply.github.com Oggetto: Re: [tonsky/FiraCode] Add markers for special Unicode characters (#1165)

I suspect rendering ZWNJ might break e.g. emoji

I don’t think it would. An emoji ligature does not require a zwnj, generally you’d only need the zwnj to prevent the emoji ligature from happening. But I think control characters like zwnj require software support, as software will usually not print these characters.

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://eur04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftonsky%2FFiraCode%2Fissues%2F1165%23issuecomment-739944242&data=04%7C01%7C%7Cb734c5d5e328404765ab08d89aba73c7%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637429472873481159%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=uPR%2BCYGNxvdJYwoX7fbLSHRISE0mETnRuPsnhgRmlts%3D&reserved=0, or unsubscribehttps://eur04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAMRJI3CYWMIJPAUP74S72ELSTTPNLANCNFSM4UPVQE4A&data=04%7C01%7C%7Cb734c5d5e328404765ab08d89aba73c7%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637429472873481159%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=yG8LpUE4fd2MxKx0HexC0Nu0Po%2B2m634wRQ55kxbAIA%3D&reserved=0.