Skip to content
This repository was archived by the owner on Mar 3, 2023. It is now read-only.
This repository was archived by the owner on Mar 3, 2023. It is now read-only.

Ligatures aren't spaced correctly #3821

Closed

Description

@YawarRaza7349

I'm using the Atom for Windows Alpha from the Atom website (not Chocolatey), version 0.136.0 (as viewed in the Help menu and with --version in the command line, the version file in the Atom folder says v0.17.1; it was downloaded around 12:30AM US Eastern on October 14, 2014 if that helps) on Windows 8.1. I set text-rendering: optimizeLegibility; for .editor in styles.less (because otherwise the ligatures aren't in effect and I get each individual character). This happens regardless of whether hardware acceleration is enabled. It also happens in --safe mode, and the developer tools console shows no errors.

temp

(<*>)::Functor f=>(a->b)->(f a->f b)
fmap::Functor f=>(a->b)->(f a->f b)

in Hasklig, which has ligatures for <*>, ::, =>, and ->.

temp

fifififififififififi

in Calibri, using the ligature for fi. The cursor is at the end of the line, and the misspell underline only leads up to that point as well. The ligature for ff in Calibri has the opposite effect; the cursor and underline extend farther than text on the screen if you put enough f's on a line.

I can provide more details if you need them.

Activity

  1. ai commented on Jan 9, 2015

    @ai
    body {
        -webkit-font-feature-settings: "liga" 1;
        font-feature-settings: "liga" 1;
        text-rendering: optimizeLegibility;
    }

    makes little bit better, but not enough

  2. ai commented on Jan 9, 2015

    @ai

    Also same problems are with Fire Code

  3. ai commented on Jan 9, 2015

    @ai
  4. benogle commented on Jan 9, 2015

    @benogle
    Contributor

    Try disabling Use hardware acceleration in the settings. Does that help?

  5. ai commented on Jan 10, 2015

    @ai

    @benogle thanks for advice. But it really not help. LIgatures behaviour is totally same without “Use hardware acceleration”.

  6. winstliu commented on Jan 10, 2015

    @winstliu
    Contributor

    Refs #2880 (possible duplicate).

  7. ai commented on Jan 10, 2015

    @ai

    @50Wliu nope. #2880 is about disabled rendering ligatures (two symbols instead of one) and this issue is about wrong caret position on font with ligatures.

  8. winstliu commented on Jan 10, 2015

    @winstliu
    Contributor

    Oh, whoops.

  9. killercup commented on Feb 5, 2015

    @killercup

    Is there any progress on this? A recent update (I guess it was 0.177) made this much worse for me.

    Compare the position of colons and semicolons, for example:

    styles_less_-_users_pascal_documents_uni_2014ws-pg-web_episodefever-ausarbeitung-_atom

    styles_less_-_users_pascal_documents_uni_2014ws-pg-web_episodefever-ausarbeitung-_atom

  10. benogle commented on Feb 5, 2015

    @benogle
    Contributor

    @killercup what font are you using?

  11. killercup commented on Feb 5, 2015

    @killercup

    That's Hasklig (same as a previous commenter IIRC).

    On Thu, Feb 5, 2015 at 7:51 PM, Ben Ogle [email protected] wrote:

    @killercup what font are you using?

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

  12. asamiam commented on Feb 7, 2015

    @asamiam

    I'm having the same issue and it makes it impossible to use - the cursor shows up far left of where it actually is on the page; I switched to Atom for its support of ligatures (Hasklig). (OSX - and I've disabled hardware acceleration as well)

  13. jutaro commented on Feb 7, 2015

    @jutaro

    I would like to use Hasklig with ligatures as well. Unusable on Linux (tried with all kind of options). Please fix!

  14. 33 remaining items

  15. as-cii commented on Oct 8, 2015

    @as-cii
    Contributor

    I think so, as on master Atom now behaves exactly as Chrome <textarea>. This is how Monoid support looks like without any particular configuration (except for text-rendering: optimizeLegibility):

    monoid

    Unfortunately, Hasklig/Fira Code are not 100% supported as Chrome won't report the exact space between characters when there is a ligature (e.g. they seem to be considered as a single character), so the cursor won't be positioned "inside" it:

    hasklig

    However, we now degrade gracefully and allow the cursor to be positioned correctly even on subsequent characters without any special configuration. So, you shouldn't see stuff like the following happening anymore:

    master

    Ideally I'd love to put a break in between characters when some kind of edit action is happening, but that comes with a performance overhead because we'd have to change the line every time e.g. a cursor is moved.

    I am going to close this for now, as Atom should now be usable regardless of the font configuration and behaves exactly like Chrome text area does. Please, let me know if we should reopen this because of some issue I am not taking into account.

    Thanks everyone! 🙏

  16. Rydgel commented on Oct 8, 2015

    @Rydgel

    @as-cii This looks much better indeed, thank you. Is this patch scheduled on the next stable release?

  17. MrLoh commented on Oct 8, 2015

    @MrLoh

    When will this be active? In the current Atom the ligatures work mostly fine (no rendering of != though) but there are a bunch of spacing issues with text when text-rendering: optimizeLegibility is on.

  18. thomasjo commented on Oct 8, 2015

    @thomasjo
    Contributor

    When will this be active?

    Most likely in the v1.2.0 release I believe (unless some serious regressions are discovered). If you want it immediately, consider building the master branch yourself. It's fairly straight forward.

  19. alexandernst commented on Oct 8, 2015

    @alexandernst

    @thomasjo WIll text-rendering: optimizeLegibility be enabled by default? aka, will ligatures work out of the box?

  20. thomasjo commented on Oct 8, 2015

    @thomasjo
    Contributor

    WIll text-rendering: optimizeLegibility be enabled by default?

    No, that hasn't changed. I could see that being introduced as a configuration option though... I'm pretty sure such a PR would be accepted 😏

  21. altaic commented on Oct 9, 2015

    @altaic

    This is great; thank you so much.

  22. gusaiani commented on Oct 9, 2015

    @gusaiani

    Thanks to everyone who made this happen.

  23. Fresheyeball commented on Oct 9, 2015

    @Fresheyeball

    This made my day. Thank you so much for making this happen.

  24. added a commit that references this issue on Oct 15, 2015
  25. hyiltiz commented on Oct 26, 2015

    @hyiltiz

    Cheers for making this happen!

  26. ngeor commented on Sep 25, 2016

    @ngeor

    I stumbled upon this post trying to understand why the "Space Mono" font renders the characters "fi" funny (and converts html closing tags into arrows). Linux with Atom 1.9.9 and Mac OS X with Atom 1.10.2, for me a fine workaround is to shut down this feature completely by adding this to the stylesheet:

    atom-text-editor {
      -webkit-font-feature-settings: "liga" off, "calt" off;
    }
    

    after that the font works fine.

  27. lock commented on Apr 5, 2018

    @lock

    This issue has been automatically locked since there has not been any recent activity after it was closed. If you can still reproduce this issue in Safe Mode then please open a new issue and fill out the entire issue template to ensure that we have enough information to address your issue. Thanks!

  28. locked and limited conversation to collaborators on Apr 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions