oetiker / rrdtool-1.x

RRDtool 1.x - Round Robin Database
http://www.rrdtool.org
GNU General Public License v2.0
1.01k stars 263 forks source link

The character on the graph looks clipped when using some mono font with new version of rrdgraph #1174

Open k79e opened 2 years ago

k79e commented 2 years ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce Just use the newest version 1.8.0 to generate graphs. Using the font "WenQuanYi Micro Hei Mono"

Expected behavior A clear and concise description of what you expected to happen. It should not clipped

Screenshots If applicable, add screenshots to help explain your problem. The 'i' of min and the top of 120k is clipped image

On the old version this is fine. image

Desktop (please complete the following information): Win7 x64

Additional context Add any other context about the problem here.

c72578 commented 2 years ago

@k79e Thanks for your report. Could you please add the following information:

k79e commented 2 years ago

I think tried both mingw and vc version. Old version is previous version RRDtool 1.7.2.

Create a test.bat with

@set rrdfile=e\:\test.rrd

@rrdtool graph e:\test.png --vertical-label "Network Data" ^
--title "1Min Network Traffic Stats" --width 600 --height 250 -s end-100min -S 60s -n DEFAULT:0:"WenQuanYi Micro Hei Mono" ^
DEF:in=%rrdfile%:in:LAST ^
DEF:out=%rrdfile%:in:LAST ^
VDEF:imax=in,MAXIMUM  ^
VDEF:omax=out,MAXIMUM  ^
VDEF:imin=in,MINIMUM  ^
VDEF:omin=out,MINIMUM ^
AREA:out#00ff00:"OUT" ^
GPRINT:out:LAST:"Current\: %%5.1lf %%sbytes/min", ^
GPRINT:omin:"Low\: %%5.1lf %%sB/min", ^
GPRINT:omax:"Max\: %%5.1lf %%sB/min" ^
COMMENT:"\l" ^
LINE1:in#086ae5:"IN" ^
GPRINT:in:LAST:" Current\: %%5.1lf %%sbytes/min", ^
GPRINT:imin:"Low\: %%5.1lf %%sB/min", ^
GPRINT:imax:"Max\: %%5.1lf %%sB/min" ^
COMMENT:"\l"

Create a test rrdfile

rrdtool create test.rrd -s60 DS:in:DERIVE:120:0:U ^
RRA:LAST:0:1:1440
rrdtool update test.rrd -t in N:3
rrdtool update test.rrd -t in N:1

use cmd go into the newest version. run the test.bat file And use previous version to run test.bat

The newest version generated graph test

Previous version's test

I tested arial font and can't trigger bug. So maybe only the mono font can cause problem. You need the font here https://sourceforge.net/projects/wqy/files/wqy-microhei/0.2.0-beta/