-
Notifications
You must be signed in to change notification settings - Fork 590
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
font hintstyle/antialias in editor differ from settings font #3610
Comments
Can you bisect the exact commit where you started getting the blurry text? (I don't see anything too bad myself.) |
You need to find out what font is "Monospace Regular", that name is an alias for another font, not a font itself. Without knowing the actual font we have no way of replicating the problem as @techee said. |
Comparing GTK2 and GTK3 was not your initial issue. Possibilities:
As we don't have access to your system you will have to do the research, 1. and 2. you will need to check dependency versions for the libraries mentioned and versions of the fonts. To see if there have been any changes in Scintilla operation you can check its changelog on its website. Quite frankly the GTK3 looks right, having aliasing only on one side of the verticals as the GTK2 shows is "unusual". |
Thanks everyone for the detailed answers! I just tested geany 1.38 (2022-05-01) from the official arch repo. The font there looks "sharp" as I wanted. It uses GTK+ v3.24.38, the same one I used building latest commit version from source. I tested geany with gtk2 too, font is sharp. I have to do some research and find out on which commit it starts blurry. It will take some time then I will write the results here. |
I didn't understand the issue completely yet but anyway maybe it's worth to try SciTE (https://archlinux.org/packages/extra/x86_64/scite/) to check whether it has the same problem. @poluyan when you are bisecting, maybe check with a commit before 19336d2, this was the latest Scintilla update. |
Try the merges that change Scintilla versions first. |
Heh, overlapping comments Great minds think alike :-) |
Thanks Neil, that could explain the difference between GTK2 (Scintilla 3.5) Geany and GTK3 current git (Scintilla 5.3.7) Geany. As I said above, the images posted by the OP show the current aliasing to be more correct than the GTK2 version which never seems to alias both sides of the verticals. The OP has not identified the font used, I compared my system Monospace (DejaVu sans mono) and Hack and the aliasing does change between them, with Hack having less, maybe slightly different character positioning in the glyph space, differing hinting? @poluyan Aliasing is always going to have the chance of looking fuzzy on some resolutions with some fonts, so not sure what we can say except try different fonts to find one that suits your eyes (like the one on Arch you found). |
@eht16 Thank you, I have checked, this is exactly the place where font starts to be blurry. I tried SciTE with Thanks for the quick replies. This issue can be closed. |
@poluyan just to remind you, "Monospace" is not a font, it is an alias for one. Use |
Is it fixed though and is this a problem of the used font? I'm not really familiar with pango and what exact implications the commit Neil mentioned had in Scintilla but it appears it triggered this problem. |
IIUC it "triggered" the problem by doing it (more) correctly :-) In reality there will always be cases where the screen resolution being used and the way the font places characters and the way floating point calculations round to integer pixels and colours can result in text appearing "fuzzy" to a viewer. That is actually its point of course, to "simulate" fractional pixels by shading adjacent ones and hope the viewers eyes will average it. But some viewers on some screens will see it differently. As it involves individual visual response its not an exact science, so it can never be "fixed" for everyone. So the best advice is to try a different font. Its not that one or the other font is "wrong" just that they generate differing visuals, and again, thats what fonts are for, if they were identical there would be no point in having more than one. |
@elextr what you're describing is hinting ;) The trade-off between faithful glyph shape rendering versus blurry render because pixels are big. And I agree that better hinting is better, but it's tricky. I admittedly got used to bad one because some upgrade lead to poorer hinting everywhere on my system and it's not bad enough that I spend a whole lot of time on it, but still, I'd rather have it sharp and slightly off-shape than perfectly shaped and blurry. |
Yeah, hinting is the info in the font file that tells how to calculate the antialiasing. New addition to Geany license, users may only use Geany if they sit far enough from their screen that they can't see the pixels 😁 |
If anyone is sufficiently motivated to write a sensible patch, there could be an option to choose position rounding on/off. Probably added as a bit flag to SCI_SETFONTQUALITY. |
@nyamatongwe can you please be more specific? I've tried to modify patch you mentioned above. I commented macros lines in There is actually more. I just now noticed that at my system Scintilla do antialiasing for same characters differently (for mono fonts). That's probably why I was annoyed with the font look. Here's comparison of geany (above) with gedit (below) with DejaVu Sans Mono and JetBrains Mono Regular. For Now I'm using terminus bold font and quite satisfied with it. However it is a bit "lazy" solution because there is no antialiasing involved at all. 😁 |
Oh, it have to be set to For those facing a problem in the future: in file scintilla/gtk/PlatGTK.cxx SetFractionalPositions I removed macros guard and change boolean calling argument. Just run the following commands below before building geany (e.g. for geany-git in arch I did it in prepare function in PKGBUILD).
|
I use arch with xfce4. After last update of geany-git (git >= 1b06889) I have blurry text inside editor. Only in editor, fonts in menu/settings are good. Check out font view from editor settings and inside editor.
Can I change hintstyle/antialias with custom font settings at the start? Is it geany or purely GTK issue? removing
.config/geany
didn't change anything.The text was updated successfully, but these errors were encountered: