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

Partial IntelliJ IDEA support #96

Closed
Grawl opened this issue Dec 22, 2015 · 52 comments
Closed

Partial IntelliJ IDEA support #96

Grawl opened this issue Dec 22, 2015 · 52 comments

Comments

@Grawl
Copy link

Grawl commented Dec 22, 2015

From version of 15 EAP there is a partial support for ligatures with editor.enable.optional.ligatures=true in bin/idea.properties file.

In OS X, the bin folder is located inside of the application itself, for example: /Applications/IntelliJ IDEA 16 EAP/ Context menu -> Show package content /Contents/bin/idea.properties.

Here is a proof:

2015-12-22 16 03 57

As you can see, ligatures appears if there is a letter (not number) beside.

I created a test case for this:

            .=a .-a :=a =:=a
         ==a !=a ===a !==a =/=a

     <<-a <--a <-a b<->a b-> b--> b->>
<=<a <<=a <==a     b<=>a b=> b==> b=>> b>=>
     >>=a >>-a >-a       b-< b-<< b=<<
          <~~a <~a b~~~a b~> b~~>

     <<<a <<a <=a  b<>a  b>= b>> b>>>
               <|a b<|>a b|>

               <$a b<$>a b$>
               <+a b<+>a b+>
               <*a b<*>a b*>

         \\a \\\a b{- -}a b// b///
             /*a /**a b**/ b*/
          </a <!--a www  b--> b/>
            0xF 9:45a m-x *ptr

       ;;a ;;;a ::a :::a !!a !!!a
       ??a ???a %%a %%%a &&a &&&a
       ||a |||a ..a ...a b..< a[]b
       --a ---a ++a +++a **a ***a

          ~=a ~-a -~a =~a ~@a
        ^=a ?=a /=a /==a |=a ||=a
           ##a ###a ####a
         a#{b a#[b a#(b a#?b a#_b a#_(b

a*b a*A B*b A*B *a *A a* A*
a-b a-A B-b A-B -a -A a- A-
a+b a+A B+b A+B +a +A a+ A+
a:b a:A B:b A:B :a :A a: A:

And this is how it looks in IntelliJ IDEA 16 EAP v144.2151.16:

2015-12-22 16 03 38

As you can see, every ligature that based on 2 glyphs is working, except of any brackets <>[]{}()

But without letter beside there is nothing as I described above:

2015-12-22 16 03 33

So, basically, we can add this info in repository readme.

@dmitriid
Copy link

Didn't work for me on 16 EAP :(

@vlad-shatskyi
Copy link
Contributor

@dmitriid, for some reason, it doesn't work for all file types. If you create a new scratch buffer, the ligatures will work.

@dmitriid
Copy link

@ShockOne Nope :) Didn't work for the new scratch buffer either :) I guess we can call the support is "spotty". But yay for you! You got it working

@Grawl
Copy link
Author

Grawl commented Dec 22, 2015

@dmitriid did you forget to add editor.enable.optional.ligatures=true in idea.properties?

@dmitriid
Copy link

Nope, done that. Then launched IDEA, all fonts look as they did before. In any type of file, in any type of scratch file

@tonsky
Copy link
Owner

tonsky commented Dec 22, 2015

Heh. Worked for me on Idea 15 with modified idea.properties. For some
reason Idea decided to use Light weight by default, and it only worked with
a letter right after the ligature. Silly

On Tue, Dec 22, 2015 at 3:31 PM dmitriid [email protected] wrote:

Nope, done that. Then launched IDEA, all fonts look as they did before. In
any type of file, in any type of scratch file


Reply to this email directly or view it on GitHub
#96 (comment).

@tylermenezes
Copy link

This isn't actually a fully working test case just yet: there are some problems which only show up when syntax highlighting is used.

@JB-Dmitry
Copy link

Hello,

I'm a JetBrains employee, working now on supporting ligatures in IDEA. There's a reason why Fira Code in its current state cannot be supported in IntelliJ IDEA at the moment, some details about this can be found e.g. here. But there's a 'refactoring' for the font, which can make it work.

I could provide a patch, if font's source code would be available in open format, but I don't have Glyphs app, so I can only explain the idea here. Basically, DFLT script tag shouldn't be used in OpenType features mapping, tags for all scripts supported by font should be used instead. For Fira Code this means, 'DFLT dflt' script/language pair should be replaced with 'zyyy dflt' 'zinh dflt' 'cyrl dflt' 'grek dflt' ('latn' script is already declared).

I've tested font modified in such a way, and didn't see any regressions in any editors on any platform so far.

@tonsky
Copy link
Owner

tonsky commented Dec 24, 2015

Hi @JB-Dmitry!

I’ll see what I can do about it.

Does removing DFLT solves the issue when ligatures only render if a letter is placed before/after it?

@JB-Dmitry
Copy link

Yes, I think it should solve it.

@tonsky
Copy link
Owner

tonsky commented Dec 24, 2015

@JB-Dmitry here’s a test build https://dl.dropboxusercontent.com/u/561580/Fonts/FiraCode/FiraCode_1.102.zip

I kept languagesystem DFLT dflt; but added what you’ve suggested. Works for me (with addition of editor.enable.optional.ligatures=true) (I use OS X and IDEA 15 community edition).

Folks in this thread, can you please test it in Windows/Linux and report back?

@JB-Dmitry any ideas why Idea chooses Light weight by default and how to change that?

@tylermenezes
Copy link

That works for me on Linux! You're all awesome for looking into this so much!

@JB-Dmitry
Copy link

I kept languagesystem DFLT dflt; but added what you’ve suggested.

That should also work, thanks.

any ideas why Idea chooses Light weight by default and how to change that?

I couldn't reproduce that. What JDK are you using to run IDEA (can be found in 'About' screen)?

@Grawl
Copy link
Author

Grawl commented Dec 25, 2015

Works on OS X! Great!

@tonsky
Copy link
Owner

tonsky commented Dec 25, 2015

@JB-Dmitry it must be related to editor.enable.optional.ligatures=true somehow. If I enable it, it starts using Ligth weight for Fira Code, Bold weight for Input Mono, etc. Once I disable it, it chooses correct regular weight for both. Checked on 15 and 16 EAP Ideas (OS X)

screen shot 2015-12-26 at 00 55 53

screen shot 2015-12-26 at 01 04 55

@dmitriid
Copy link

Laugh all you want, still doesn't work for me on either 15 or 16 EAP :)

@dmitriid
Copy link

Link to my full IDEA settings in case anyone wanna take a look (perhaps some setting somewhere interferes):

https://dl.dropboxusercontent.com/u/2966998/idea/Mamut-15.jar
https://dl.dropboxusercontent.com/u/2966998/idea/Mamut-16-EAP.jar

@JB-Dmitry
Copy link

@tonsky Thanks, now I can reproduce it. Will try to fix in one of the upcoming IDEA 16 EAP builds.

@dmitriid What OS do you have?

@dmitriid
Copy link

@JB-Dmitry

OS X 10.11.2 (15C50)

IDEA Ultimate 15 IU-143.1559.1
IDEA Ultimate 16-EAP IU-144.2151.16

@dmitriid
Copy link

@JB-Dmitry I'm adding the editor.enable.optional.ligatures=true to /Applications/IntelliJ Idea (15|16).app/Contents/bin/idea.properties

@JB-Dmitry
Copy link

@dmitriid Please try next IDEA 16 EAP build (to be released). If it still won't work, attach your log file here or at https://youtrack.jetbrains.com/issue/IDEA-127539.

@dmitriid
Copy link

@JB-Dmitry Done

@JB-Dmitry
Copy link

The following builds have some fixes related to support of ligatures on Mac OS:
IDEA Community build 144.2641
IDEA Ultimate build 144.2641
(corresponding changes didn't make it to the next official EAP build, and will be available in EAP builds later in January)

@tonsky Issue with picking of Light font version should be fixed there.

@dmitriid Try one of these builds, and attach logs from them.

@dmitriid
Copy link

@JB-Dmitry Still nothing :( https://youtrack.jetbrains.com/issue/IDEA-127539#comment=27-1266742

I removed the font, reinstalled it from the link above. Set ligatures=true, nothing :(

@igorsantos07
Copy link
Contributor

I've tried installing Fira Code on my Mint Petra, to use it with PHPStorm 10.0.2, but... I got a huge performance penalty. I tried simply navigating PHP, Blade and Markdown files, but all of them makes my CPU graph go crazy. The files are not big, but are from the same project. A markdown scratch file presents the same issues.

The problem does not happen with Hasklig, though. The performance is normal with it.

Should I open a separate issue about IntelliJ performance?

@tonsky
Copy link
Owner

tonsky commented Jan 2, 2016

@igorsantos07 I have experienced the same. Reported here

@artem-p
Copy link

artem-p commented Jan 18, 2016

Tried on Ubuntu 14.04 with AndroidStudio 2.0 Preview 4. Also had performance problem.

@JB-Dmitry
Copy link

Time required for application of OpenType substitution rules in the font is approximately proportional to the number of matching rules - as, more often then not, rules don't match, we need to go over each rule for each character/glyph in input string.
It looks like Fira Code might use much less rules to implement the same logic. E.g. currently 4 matching rules (lookup subtables) are used to implement <!-- ligature:

sub less' lookup A exclam hyphen hyphen;
sub CR.00 exclam' lookup B hyphen hyphen;
sub CR.00 CR.00 hyphen' lookup C hyphen;
sub CR.00 CR.00 CR.00 hyphen' lookup D;

(in feature file syntax)

The same can be implemented using just one rule:

sub less' lookup A exclam' lookup B hyphen' lookup C hyphen' lookup D;

Most of ligatures in Fira Code are for two or three characters, so I'd expect at least 2x performance improvement after such refactoring for all rules. Not sure this will be enough for eliminating performance issues completely, but potential gain seems worth trying.

Disclaimer. This is applicable for ICU layout engine. It's probably also true for other OpenType layout engines, but I've not checked that.

@FoxxMD
Copy link

FoxxMD commented Feb 2, 2016

👍 Thanks for all the hard work @JB-Dmitry @tonsky , really looking forward to having ligatures in 2016! (hopefully 😄 )

@dmitriid
Copy link

dmitriid commented Feb 5, 2016

Great many thanks to everyone involved 👍

@singalen
Copy link

IDEA 145.257 still picking up Fira Code Light if ligatures are enabled on Mac OS X 10.11.

@jessedobbelaere
Copy link

@singalen Same here in PhpStorm 2016.1
I tried deleting the light Fira Code font. Without enabling the ligatures option (Editor -> Colors & Fonts -> Font), it works fine and is using the regular weight. When I enable ligatures, it switches to a light font (looking like anti-aliasing is off so looks quite horrible). Let me know if there's a solution...

@curtosis
Copy link

I get the ugly anti-aliased version with ligatures enabled, whether I have Fira Code Light installed or not (OS X 10.11, IDEA 2016.1.1/IC-145.597).

@ryanwinchester
Copy link

ryanwinchester commented Apr 21, 2016

I also have removed FiraCode light.

No matter which font I use, I get an ugly "light" version of it if I click on enable ligatures. I don't think it's a problem with FiraCode.

PHPStorm 2016.1 on OS X 10.11.4

PHPStorm settings

@tonsky
Copy link
Owner

tonsky commented Apr 22, 2016

It’s not a light version, IDEA just switches to different font rendering
algorithm which looks lighter

On Fri, Apr 22, 2016 at 12:03 AM Ryan Winchester [email protected]
wrote:

No matter which font I use, I get an ugly "light" version of it if I click
on enable ligatures.

e.g.

[image: PHPStorm settings] https://youtu.be/iH7Wn9LP4Uw


You are receiving this because you were mentioned.

Reply to this email directly or view it on GitHub
#96 (comment)

@FoxxMD
Copy link

FoxxMD commented Apr 22, 2016

@tonsky thanks for the clarification.

@singalen @ryanwinchester @curtosis @jessedobbelaere I think these problems may be resolved in the 2016.2 update for intellij, fingers crossed!

@polacekpavel
Copy link

In the new release of EAP 2016.2. Works pretty well. (WebStorm, MAC OS X)

@jessedobbelaere
Copy link

Seems fixed in the EAP 2016.2 that was released for PHPStorm yesterday too 👍

@TylerJPresley
Copy link

Looks like it's partially working in Webstorm-EAP. Italics are not working. Anyone else seeing this?

@dmitriid
Copy link

dmitriid commented Jun 8, 2016

nope, this comment was wrong, my bad

@Heziode
Copy link

Heziode commented Jun 26, 2016

Ligature of Fira Code doesn't work for me too in IntelliJ 16.1.3

@ghost
Copy link

ghost commented Jul 13, 2016

Are ligatures working for anyone with 2016.2? I can't get them to work no matter what font I try.

@tonsky
Copy link
Owner

tonsky commented Jul 13, 2016

Have you enabled them in settings panel (not in property file)?

On Wed, Jul 13, 2016 at 10:17 PM Peter Malone [email protected]
wrote:

Are ligatures working for anyone with 2016.2? I can't get them to work no
matter what font I try.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#96 (comment), or mute
the thread
https://github.com/notifications/unsubscribe/AARabI_IhwyXQdhw9Du4ZNs6fIdR2yiuks5qVQ-CgaJpZM4G5u6W
.

@bwolf
Copy link

bwolf commented Jul 13, 2016

@petermalone Yes!
screen shot 2016-07-13 at 19 05 02

screen shot 2016-07-13 at 19 08 27

@sinaptik
Copy link

Is there a way to pick font weight?

I can see the various font weights in: Settings -> Appearance & Behavior -> Appearance -> Override default fonts by

But cannot see the weights in: Settings -> Editor -> Colors & Fonts -> Font -> Primary font

I'd love to use a lighter weight version of FiraCode...

@jbellsey
Copy link

Same problem here. OSX 10.10, RubyMine 2016.1.2, using settings panel to enable.

Ligatures on => thin weight, ugly font rendering
Ligatures off => regular weight, nice rendering

Ligatures-on rendering is very usable on Retina display, but not on external Samsung crapdisplay. On Retina, the font weight is thinner but still well-rendered.

Same issue with Hasklig.

@ryanwinchester
Copy link

ryanwinchester commented Jul 15, 2016

This was fixed for me in PhpStorm 2016.2

@tonsky tonsky closed this as completed Jul 16, 2016
@allmycode
Copy link

Not all ligatures works in some buffers: in java buffers for example <= works , but not >=. In example window all works perfectly.

@tonsky
Copy link
Owner

tonsky commented Jul 18, 2016

@allmycode please report that to tracker. They are really serious about ligatures now

@tonsky
Copy link
Owner

tonsky commented Jul 18, 2016

To the Intellij tracker. There's a link somewhere in the thread

@dmitriid
Copy link

@i-oliva
Copy link

i-oliva commented Jan 19, 2018

I am still getting a weird version of Fira Code in intellij. VSCode Fira Code font looks quite better

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