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

Implement basic font rendering tuning for code editor. #83

Closed
wants to merge 1 commit into from

Conversation

13-beta2
Copy link

Ability to disable anti-aliasing for 'pixel-perfect' fonts like Courier
New.
Ability to disable hinting to forget about jagged default WPF rendering.

I certify that I own, and have sufficient rights to contribute, all source code and related material intended to be compiled or integrated with the source code for the #develop open source product (the "Contribution"). My Contribution is licensed under the MIT License.

@dgrunwald
Copy link
Member

Why should this be part of AvalonEdit? Especially the "CurrentZoom" hack doesn't seem like it belongs into the library. (what about zoom controls using a different property name?)

The TextOptions are usually set on the whole Window and then are inherited into all controls (including AvalonEdit); so I don't see a need to override the TextOptions from within AvalonEdit.

If you are using AvalonEdit within a zoom control that needs to dynamically switch the TextOptions, that feature should be part of the zoom control, not AvalonEdit.

@13-beta2
Copy link
Author

13-beta2 commented Jan 2, 2016

Thanks for your feedback! You are right, I'm not very familiar with #develop architecture and could do some stupid mistakes. I'll try to correct this feature using your suggestions.

…s part)

Ability to disable anti-aliasing for 'pixel-perfect' fonts like Courier New.
Ability to disable hinting to forget about jagged default WPF rendering.
@13-beta2
Copy link
Author

If you are using AvalonEdit within a zoom control that needs to dynamically switch the TextOptions, that feature should be part of the zoom control, not AvalonEdit.

Main logic moved to zoom widget (icsharpcode/SharpDevelop#733). AE has only one property binding. Is it ok now?

@dgrunwald
Copy link
Member

Why does AvalonEdit need this binding?

AFAIK the TextOptions.TextFormattingMode property is automatically inherited through the visual tree, so you should be able to get this to work without any change to AvalonEdit at all.

Edit: inheritance uses the logical tree, not the visual tree. That might explain why it wasn't working without the binding for you. Still, I think this should be handled completely in the zoom control, without any change to AvalonEdit.

@13-beta2
Copy link
Author

I don like this binding too. And the only way I see to remove explicit property setter is to change TextOptions.* for logical parent.

My studies has shown that parent for AE is SharpDevelopTextEditor. Moreover TextFormattingMode has already been overridden there (via ZoomLevelToTextFormattingModeConverter). So I can just append more complex logic to template ('\src\AddIns\DisplayBindings\AvalonEdit.AddIn\themes\generic.xaml'). This will remove requirement to bind explicitly. But I cant find does '\src\AddIns\DisplayBindings\AvalonEdit.AddIn*' subtree should be considered as a part of SD or still as part of AE project?

Main disadvantage is that all other text within SharpDevelopTextEditor will remain be inconsistent with rest of UI. Eg I believe that reset zoom button should looks like any other button/label.

@dgrunwald
Copy link
Member

The AvalonEdit rendering mode can be controlled by setting TextOptions.TextFormattingMode and letting WPF property inheritance do its work. I don't see any need for a change in AvalonEdit here.

@dgrunwald dgrunwald closed this May 25, 2017
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

Successfully merging this pull request may close these issues.

2 participants