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

Hyphen based ligatures don't work in WPF #259

Open
citizenmatt opened this issue Aug 29, 2016 · 15 comments
Open

Hyphen based ligatures don't work in WPF #259

citizenmatt opened this issue Aug 29, 2016 · 15 comments

Comments

@citizenmatt
Copy link

This is related to the issues people have reported with Visual Studio where ligatures that contain a hyphen, such as -> or <!-- don't work in Visual Studio.

It actually looks like this might be a generic WPF issue, rather than just Visual Studio.

I created a dummy WPF application that simply included a TextBlock, Label and FlowDocumentReader. The TextBlock and Label will display ligatures correctly, apart from those containing hyphens (e.g. ->). Strangely, the FlowDocumentReader works as expected.

screen shot 2016-08-29 at 10 51 33 am

I tried to debug the Visual Studio editor, and as best as I could follow, it's not the editor that's doing the work to display ligatures - it comes automagically from WPF and Windows. It looks like the editor is using Windows' native "Line Services" and for some reason, this component is treating the hyphen as a separate character, rather than as part of a run - and so it gets rendered separately, and not converted into a ligature. Hyphenation appears to be disabled in the Visual Studio editor code, and it's definitely disabled in the TextBlock and Label in my dummy application.

I've no idea now what's going wrong, and I strongly suspect this is a WPF/Windows issue and not something that could be fixed in the font, but I'm hoping that we get a nice friendly WPF expert wandering past who can help out.

Could it be something stupid like Windows doesn't recognise "hyphen" in the ligatures?

Anyone got any ideas?

@clairernovotny
Copy link

This isn't Windows, it's WPF. If you try in a UWP app, it renders correctly. I asked folks at VS to look into it and here's what they found so far:

Looks line LineServices (a low-level component that WPF uses to help format text) treats ‘-‘ specially, presumably for the line-breaking algorithm. With the result that it’s never placed in the same glyph run as normal characters like ‘>’. So by the time DWrite sees the text, it looks like GlyphRun(“--") GlyphRun(“> >= ==> 3/4"), and DWrite doesn’t recognize the ligature that changes ‘-->’ into the right-arrow glyph.

@citizenmatt
Copy link
Author

Nice one - very useful info! Is there any indication of a fix being worked on?

@saul
Copy link

saul commented Nov 6, 2016

@onovotny have you received any word from the guys at VS that this is being worked on?

@slang25
Copy link

slang25 commented Dec 19, 2016

@onovotny are you able to use your influence to bring this up with them another time. I think there's about a month before VS2017 changes are frozen, it would be sweet if they can get this sorted in time, sounds like they are onto the root cause.

@Porges
Copy link

Porges commented Jan 6, 2017

Here's a relevant UserVoice suggestion to get this fixed: https://visualstudio.uservoice.com/forums/121579-visual-studio-2015/suggestions/12983895-fix-ligatures

@anjelo
Copy link

anjelo commented Apr 18, 2017

@saul
Copy link

saul commented Apr 18, 2017

That's a real shame :(

@jogibear9988
Copy link

I've also added a connect issue: https://connect.microsoft.com/VisualStudio/feedback/details/3133502/ligatures-dont-work-correctly-in-wpf

@sgrottel
Copy link

Btw, it's also the same with VS 2019 preview.

@slang25
Copy link

slang25 commented Jan 19, 2019

I've just got the notification that the issue is a "wont fix" :(

@clairernovotny
Copy link

@slang25 I would wait until WPF for .NET Core 3 is fully open sourced.

@slang25
Copy link

slang25 commented Jan 19, 2019

That's a very good point!

@limbusdev
Copy link

Persists in Visual Studio 2019.1

@lifeforce-dev
Copy link

Bummer :( maybe one day it will come out of Won't Fix.

Losangelosgenetics pushed a commit to Losangelosgenetics/FiraCode that referenced this issue Mar 12, 2020
200: Update rake requirement from ~> 10.0 to ~> 12.3 r=bronzdoc a=dependabot[bot]

Updates the requirements on [rake](https://github.com/ruby/rake) to permit the latest version.
<details>
<summary>Changelog</summary>

*Sourced from [rake's changelog](https://github.com/ruby/rake/blob/master/History.rdoc).*

> === 12.3.1
> 
> ==== Bug fixes
> 
> * Support did_you_mean >= v1.2.0 which has a breaking change on formatters.
>   Pull request [tonsky#262](https://github-redirect.dependabot.com/ruby/rake/issues/262) by FUJI Goro.
> 
> ==== Enhancements:
> 
> * Don't run task if it depends on already invoked but failed task.
>   Pull request [tonsky#252](https://github-redirect.dependabot.com/ruby/rake/issues/252) by Gonzalo Rodriguez.
> * Make space trimming consistent for all task arguments.
>   Pull request [tonsky#259](https://github-redirect.dependabot.com/ruby/rake/issues/259) by Gonzalo Rodriguez.
> * Removes duplicated inclusion of Rake::DSL in tests.
>   Pull request [tonsky#254](https://github-redirect.dependabot.com/ruby/rake/issues/254) by Gonzalo Rodriguez.
> * Re-raise a LoadError that didn't come from require in the test loader.
>   Pull request [tonsky#250](https://github-redirect.dependabot.com/ruby/rake/issues/250) by Dylan Thacker-Smith.
> 
> === 12.3.0
> 
> ==== Compatibility Changes
> 
> * Bump `required_ruby_version` to Ruby 2.0.0. Rake has already
>   removed support for Ruby 1.9.x.
> 
> ==== Enhancements:
> 
> * Support `test-bundled-gems` task on ruby core.
> 
> === 12.2.1
> 
> ==== Bug fixes
> 
> * Fixed to break Capistrano::Application on capistrano3.
> 
> === 12.2.0
> 
> ==== Enhancements:
> 
> * Make rake easier to use as a library
>   Pull request [tonsky#211](https://github-redirect.dependabot.com/ruby/rake/issues/211) by [**drbrain**](https://github.com/drbrain)
> * Fix quadratic performance in FileTask#out_of_date?
>   Pull request [tonsky#224](https://github-redirect.dependabot.com/ruby/rake/issues/224) by [**doudou**](https://github.com/doudou)
> * Clarify output when printing nested exception traces
>   Pull request [tonsky#232](https://github-redirect.dependabot.com/ruby/rake/issues/232) by [**urbanautomaton**](https://github.com/urbanautomaton)
> 
> ==== Bug fixes
> 
> * Account for a file that match 2 or more patterns.
>   Pull request [tonsky#231](https://github-redirect.dependabot.com/ruby/rake/issues/231) by [**styd**](https://github.com/styd)
></table> ... (truncated)
</details>
<details>
<summary>Commits</summary>

- See full diff in [compare view](https://github.com/ruby/rake/commits/v12.3.1)
</details>
<br />

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

---

**Note:** This repo was added to Dependabot recently, so you'll receive a maximum of 5 PRs for your first few update runs. Once an update run creates fewer than 5 PRs we'll remove that limit.

You can always request more updates by clicking `Bump now` in your [Dependabot dashboard](https://app.dependabot.com).

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot ignore this [patch|minor|major] version` will close this PR and stop Dependabot creating any more for this minor/major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language
- `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com):
- Update frequency (including time of day and day of week)
- Automerge options (never/patch/minor, and dev/runtime dependencies)
- Pull request limits (per update run and/or open at any time)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)

Finally, you can contact us by mentioning @dependabot.

</details>

Co-authored-by: dependabot[bot] <[email protected]>
Losangelosgenetics pushed a commit to Losangelosgenetics/FiraCode that referenced this issue Mar 12, 2020
259: Add PR template r=bronzdoc a=bronzdoc

Add PULL_REQUEST template to the project

Co-authored-by: bronzdoc <[email protected]>
@HolisticDeveloper
Copy link

I overlooked this when scanning the history of this issue so I thought I would post an explicit comment. The issue is now tracked in the WPF team's GitHub issues: dotnet/wpf#109

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