notepad4 icon indicating copy to clipboard operation
notepad4 copied to clipboard

toolbar icon is blurred in Hi-DPI screen

Open WanderMax opened this issue 4 years ago • 35 comments

I use version Notepad2_x64_v4.20.03r2680, screen size is 4K and set system scale ration 250%. I find that toolbar icon is blurred in my screen as snapshot below: image

I think toolbar icon maybe small in resolution or not fit for hi-dpi screen.

WanderMax avatar Apr 04 '20 06:04 WanderMax

We don't have Hi-DPI toolbar image for Notepad2, the toolbar image is auto resized based on current DPI. for metapath, we have SVG sources (from Visual Studio Image Library 2017) for toolbar images (see issue #89), it can be fixed.

Notepad2 use <gdiScaling>false</gdiScaling>, while metapath use <gdiScaling>true</gdiScaling>. can you also upload screenshot for metapath, and screenshots for following dialogs: Scheme > Syntax Scheme... > Select Scheme dialog File > Encoding > More > Select Encoding dialog File > Favorites > Open Favorites... > Favorites dialog

Related issues: #45, #46

zufuliu avatar Apr 04 '20 06:04 zufuliu

metapath: image image image image

WanderMax avatar Apr 04 '20 06:04 WanderMax

Thanks, metapath's toolbar image looks better than Notepad2's on Hi-DPI screen, but we need to turn of GDI auto scaling on the main editor window.

The image on TreeView (the Select Encoding dialog, see issue #121) is smaller than expected, the folder icon is nearly invisible, which will also affect other schemes dialogs (see issue #169) .

zufuliu avatar Apr 04 '20 07:04 zufuliu

yeah, I hope it can be of help for you.

WanderMax avatar Apr 04 '20 08:04 WanderMax

@WanderMax Can you help test 2f3baf2ddd5ce6ce73e47efb99a6cf651d9740b4, pre-built packages is available at (or you can click Notepad2's Help > Latest Build menu) https://ci.appveyor.com/project/zufuliu/notepad2/builds/31952662/job/9ir1ihxjkmc8b85a/artifacts

I also want to know whether code folding lines/markers is very thin on HiDPI displays. from your first screenshot, caret with line width 1 is very thin, but it can be changed from View > Caret Style, though it should default to a better one, possible line width 2.

you can copy following text into Notepad2, then change scheme to Text File, 2nd Text File or Python, then make a screenshot (after folding code on line 2) like this:

CodeFoldingLine


line 2
    line 3

line 5
    line 6

zufuliu avatar Apr 04 '20 15:04 zufuliu

image image image image

WanderMax avatar Apr 04 '20 16:04 WanderMax

Thanks, icons on Select Scheme dialog is much larger than Select Encoding dialog, I reverted the changes for Scheme dialog in 77da032d6569decaa00381ba6069d88e8bededa3.

zufuliu avatar Apr 05 '20 00:04 zufuliu

Button image on Favorites dialog is fixed in e7ae8409c36a532b67e95771158224e017f579dc.

zufuliu avatar Apr 05 '20 09:04 zufuliu

@zufuliu for latest build, could you please fix commit value to version number (highlighted)? It seems that all latest build these days are as below: image

WanderMax avatar Apr 06 '20 01:04 WanderMax

The reversion is not changed, because we use shallow clone on AppVeyor https://github.com/zufuliu/notepad2/blob/master/appveyor.yml#L35

zufuliu avatar Apr 06 '20 01:04 zufuliu

OK, I get it.

WanderMax avatar Apr 06 '20 01:04 WanderMax

@zufuliu for toolbar icon size, you can use waifu2x to get larger resolution img.

WanderMax avatar Apr 08 '20 13:04 WanderMax

@WanderMax if you have made such better toolbar images (made from the three toolbar images in https://github.com/zufuliu/notepad2/tree/master/res folder, or find toolbar images from other place)

you can use it as your Notepad2's toolbar image by open Notepad2.ini, uncomment BitmapDefault=Toolbar.bmp, and set that to the image you have. then open Notepad2, right click toolbar (or go Settings -> Appearance) uncheck "Auto Scale Toolbar", then restart Notepad2.

[Toolbar Images]
BitmapDefault=Path to My 250% Toolbar.bmp
;BitmapHot=ToolbarHot.bmp
;BitmapDisabled=ToolbarDisabled.bmp

zufuliu avatar Apr 08 '20 13:04 zufuliu

Hi @zufuliu ,

lass dich nicht erschrecken Don't let yourself be frightened/don't be scared

it's all okey imho.. i have a LG UHD.. and there is nothing bluered ...

edit: if you whant a higher resolution, tell it.. i can make it..

best Blacky

Screen 00001

blackcrack avatar Apr 08 '20 14:04 blackcrack

@blackcrack But your screenshot use Notepad3 instead of Notepad2.😂

zufuliu avatar Apr 08 '20 14:04 zufuliu

Anyway, toolbar img blurred is not the high priority, just focus on main function~

WanderMax avatar Apr 08 '20 14:04 WanderMax

@zufuliu okey, okey,... damn.. all so small.. :grimacing: :grinning: damn.. wrong file klicked.. (default like i have told... because opened N3 and was tired ..) @WanderMax :smiley: 4096x2160 bitsch ! :blush: :laughing: i hope you have good feelings now hun ! :kissing_smiling_eyes: *giggle*:laughing:

65% sharp compressed JPG

Screen 00002

i can make a 5 MB jpg file with 100% sharp , if you want :))

best regards Blacky

blackcrack avatar Apr 09 '20 04:04 blackcrack

Screen 00003

@WanderMax hey man, i have feel it funny, stay to you words :) was not bad, was funny :))))) :+1: *kiss*

best greetings Blacky

blackcrack avatar Apr 09 '20 04:04 blackcrack

100% JPG all icons be blurred if you scale the Screen, it's the Fault of MS and not of N2 !

Screen 00004

i guess the issue can closed :)

blackcrack avatar Apr 09 '20 04:04 blackcrack

@zufuliu I use this 2x size toolbar img in latest build as link below (from notepad3 repo), it seems good, sharp and clean in my screen. Here is the snapshot: without Auto scale toolbar image with Auto scale toolbar image

#171 https://github.com/rizonesoft/Notepad3/issues/2066#issuecomment-611015544

WanderMax avatar Apr 12 '20 02:04 WanderMax

@WanderMax can you test latest build https://ci.appveyor.com/project/zufuliu/notepad2/build/job/i3w6v8elisioegtj I fixed a toolbar image resizing bug in 1b483f50680f0e0852b83396315f94881203a774

Notepad3's toolbar image is purchased by Notepad3 team, you can use it as free, but I can't distribute it with Notepad2. https://github.com/rizonesoft/Notepad3#changes-compared-to-the-notepad2-mod-fork

New toolbar icons based on Yusuke Kamiyaman's Fugue Icons (Purchased by Rizonesoft)

zufuliu avatar Apr 12 '20 03:04 zufuliu

@zufuliu default toolbar with scale on/off: image

96 height toolbar with scale on/off: image

it seems that github img is post-processed after uploading, not same sharp as original.

WanderMax avatar Apr 12 '20 03:04 WanderMax

@WanderMax thank you, the new image resizing works as expected. For your 4K display, you will need a 16x2.5=40 pixel height toolbar image. if your toolbar image is already 40 pixel height, enable Auto scale toolbar has no effect.

zufuliu avatar Apr 12 '20 03:04 zufuliu

@zufuliu yes, I test notepad3, you can see my snapshot below: #https://github.com/rizonesoft/Notepad3/issues/2066#issuecomment-612557450

for large toolbar img, Auto scale will downscale img by limited height, it makes toolbar sharper. auto scale off:

  • 1:1 display toolbar img, maybe quite small or large;

auto scale on:

  • small toolbar img, enlarge img by (system scale ratio or notepad2 defined height limit ?);
  • large toolbar img, enlarge img by (system scale ratio then downscale to notepad2 defined height limit ?);

WanderMax avatar Apr 12 '20 03:04 WanderMax

@zufuliu hmm.. how big is the N3 Icons, how big be the native N2 Icons.. just a hint.. a mall icon who be not make smaller, is a minimal blurred, a bigger icon who make more smaller, is more sharp.. other is, if you move the the icons into a svg-file this icon is shared shrink or enlarged without bluring, i have use this technical at my iconthemes in kde/plasma, but at moment to i work in Win7 up to Reactos .. in png>svg can you resize the images without bluring, if you add the svg support and the issue is done .. imho.. https://www.pling.com/u/Blackcrack/products

best regards Blacky

blackcrack avatar Apr 12 '20 05:04 blackcrack

@blackcrack I don't have SVG source for these icons. icon with SVG source (metapath's toolbar image, take from Visual Studio 2017 Image Library) is already in https://github.com/zufuliu/notepad2/tree/master/tools/images folder.

zufuliu avatar Apr 12 '20 05:04 zufuliu

@zufuliu no, not source, you can pump/move the png's into svg, this is like you use inkscape as zip programm and move the png's into a an other file like svg who it's able to read the inkscape or svg library this file and can extract the pictureinformations in the right size without blurring.. you need only a svg-library to read the svg-files :) inkscape.exe -f input.php -l -o output.svg inkscape.exe -l -o output.svg input.png (Inkscape version later as 0.92) done :) :+1:

i see, this are all 16x16 px, maybe could we use 265px size with more sharper ouput later, more sharper as in N3 ;) do you have the icons more bigger ?

blackcrack avatar Apr 12 '20 05:04 blackcrack

@zufuliu more bigger icon's as source ? at home or can you tell me the source from the icontheme with more bigger icons ?

blackcrack avatar Apr 12 '20 05:04 blackcrack

I'm not familiar with Inkscape, tested following bitmap with Path -> Trace Pixel Art, don't get expected result. https://github.com/zufuliu/notepad2/blob/master/res/OpenFolder.bmp

Left is trace result (possible by potrace, http://potrace.sourceforge.net/), right is original bitmap. Inkscape

zufuliu avatar Apr 12 '20 05:04 zufuliu

@zufuliu exactly this is the issue if you make it via grafic program the Icons more bigger it's becomes blured ... this is normal, but if you use bigger icons put it into the svg via move in a svg, the inkscape make the svg the icons more smaller (getting more sharp) but the native size is over 128px or 256px and at UHD have we a more sharp icon as it's be possible with a normal png/jpg/gic extraction and display because the svg makes possible to shrink and enlarge up to the nativ Icon size and make it more bigger if need .. because the picture in 128px or 256px it is sharp in native so far ..

blackcrack avatar Apr 12 '20 05:04 blackcrack

@zufuliu if you have not a bigger Pictures as source from the 16px should we take bigger Icontheme and move it directly into a svg and make the icontheme renew with related/simular icons, so search/take a more bigger icontheme and i could make it in a svg in Openmandriva with my scripts. or you build a batchfile.. in Linux works this :

for f in *.png ;do inkscape -f $f -l ${f%.png}.svg ; done gzip -9 -S z ./*.svg

for new inkscape later as 0.92 for f in *.png ;do inkscape -o -l ${f%.png}.svg $f ; done gzip -9 -S z ./*.svg

gzip makes the z at the svg +gzip =svgz
but this is not need because be only a couples kb who makes smaller..
for n2 and a couples Icons needs only svg

if works the "for" command in dos-batch too, could it be simply in dos too.. best :)

blackcrack avatar Apr 12 '20 06:04 blackcrack

@zufuliu so, if you have a Icontheme with 128px or 256px, tell it me and we can make the n2 fit for UHD ;) i can help you with svg compilation.

blackcrack avatar Apr 12 '20 06:04 blackcrack

compare trace result with SVG source at https://github.com/zufuliu/notepad2/blob/master/tools/images/OpenFolder_16x.svg OpenFolder

All image resource comes from originally Notepad2 and metapath project at http://www.flos-freeware.ch/notepad2.html or comes from Notepad2-Mod project at https://github.com/XhmikosR/notepad2-mod . They may made by hand by Florian or @XhmikosR .

Maybe we will need to build current Notepad2's toolbar image first, Notepad2 5.0.26-beta4 has three now icons, the Replace icon (ab -> ac) looks better than our current one. 5 0 26-beta4

zufuliu avatar Apr 12 '20 06:04 zufuliu

@zufuliu

compare trace result with SVG source at OpenFolder

jepp ! great !

blackcrack avatar Apr 12 '20 06:04 blackcrack

https://github.com/rizonesoft/Notepad3/issues/2081

blackcrack avatar Apr 12 '20 11:04 blackcrack