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

WIP: Ligature support #554

Merged
merged 11 commits into from
Jul 4, 2024
Merged

WIP: Ligature support #554

merged 11 commits into from
Jul 4, 2024

Conversation

bobbylight
Copy link
Owner

@bobbylight bobbylight commented Jun 23, 2024

To render ligatures, but also support our "system selection" property where selected text is a different color, we need to update the token painting for partially-selected tokens. We need to render the token twice - once for the unselected piece(s) and once for the selected piece - to ensure ligatures are properly rendered in "both" pieces. Otherwise, if a ligature is partially selected, we'll render the individual chars instead.

Test ligatures to copy-paste:

// ligatures: ## <> => ++ ~~ <= >= <=> ->>

Things to consider:

  • RSyntaxTextArea.setFont() should update all fonts in the SyntaxScheme with ligature-related attributes
  • SyntaxSchemes should propagage ligature attributes to derived fonts
  • Themes should propagate ligataure attributes to derived fonts
  • Selections that begin or end mid-ligature should not render the individual glyphs (no line wrap)
  • Selections that begin or end mid-ligature should not render the individual glyphs (with line wrap)
  • Should there be an API for quickly setting this? - no, just document the Swing API and setFont() example

@bobbylight bobbylight force-pushed the fix-503-ligature-support branch 2 times, most recently from 99eb924 to 8cd3c42 Compare June 23, 2024 20:58
@bobbylight bobbylight force-pushed the fix-503-ligature-support branch from 8cd3c42 to 445d9d3 Compare June 28, 2024 03:20
@codecov-commenter
Copy link

codecov-commenter commented Jun 29, 2024

Codecov Report

Attention: Patch coverage is 70.29703% with 30 lines in your changes missing coverage. Please review.

Project coverage is 74.51%. Comparing base (b230bf1) to head (309d017).

Files Patch % Lines
.../src/main/java/org/fife/ui/rtextarea/FontUtil.java 40.54% 17 Missing and 5 partials ⚠️
...org/fife/ui/rsyntaxtextarea/WrappedSyntaxView.java 61.53% 2 Missing and 3 partials ⚠️
...c/main/java/org/fife/ui/rsyntaxtextarea/Theme.java 71.42% 0 Missing and 2 partials ⚠️
...n/java/org/fife/ui/rsyntaxtextarea/SyntaxView.java 92.30% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master     #554      +/-   ##
============================================
+ Coverage     74.29%   74.51%   +0.21%     
- Complexity     6839     6871      +32     
============================================
  Files           177      178       +1     
  Lines         30269    30270       +1     
  Branches       3915     3920       +5     
============================================
+ Hits          22489    22556      +67     
+ Misses         5940     5889      -51     
+ Partials       1840     1825      -15     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bobbylight bobbylight changed the title WIP: Ligature support. Selections ending mid-ligature is a problem WIP: Ligature support Jul 4, 2024
@bobbylight bobbylight merged commit 5c6b279 into master Jul 4, 2024
6 checks passed
@bobbylight bobbylight deleted the fix-503-ligature-support branch December 10, 2024 03:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants