|
From: sfeam <sf...@us...> - 2017-07-04 23:48:15
|
On Tuesday, 04 July 2017 17:47:56 Daniel J Sebald wrote: > On 07/04/2017 02:29 PM, Dmitri A. Sergatskov wrote: > > On Tue, Jul 4, 2017 at 2:05 PM, sfeam <sf...@us... > > <mailto:sf...@us...>> wrote: > > > > > > More to the point... Is it only the "test" command that has a problem? > > If so I don't think we really care that much. If boxed text in > > general is > > failing that would be a bigger issue. > > > > > > Here is the output of a script; > > > > set label "1234567890" at 0,-0.4 boxed font "DejaVuSans, 5" > > set label "1234567890" at 0,-0.2 boxed font "DejaVuSans, 7" > > set label "1234567890" at 0,0 boxed font "DejaVuSans, 9" > > set label "1234567890" at 0,0.2 boxed font "DejaVuSans, 12" > > set label "1234567890" at 0,0.4 boxed font "DejaVuSans, 14" > > set label "1234567890" at 0,0.6 boxed font "DejaVuSans, 18" > > set label "1234567890" at 0,0.8 boxed font "DejaVuSans, 24" > > plot sin(x) > > > > One can see that the problem is still there at very small (and perhaps > > very large) font sizes. > > The problem seems to be qt related. It looks fine reploted to e.g. > > pngcairo. > > With a rudimentary browsing of the code, it doesn't seem to me that we > should expect the boxed text to be too accurate. As for the test image, > it's > [snip] > which is only a rough estimate at the font-processed string width in > pixels, assuming a constant-width character. The test image code should > be placing a box similar to the way in with text/label items are placing > a box. The code in "test" predates the boxed text option by many years. It is, as you say, only a rough estimate. It used to be the best we could do. Now the boxed text option is a better alternative. > But even in the case of labels with the "boxed" qualifier, I don't see > any mechanism for either feeding the string width from the terminal back > to gnuplot so that it can draw a box, Correct. The core code gets no feedback from the terminals. For many terminals it is impossible even in theory (e.g. PostScript). > or specifying to the terminal that > it should put a box around the text it is requesting. Not correct. The boxed text option works exactly by telling the terminal it should put a box around the next block of text that is sent. The terminal does this by itself with no additional help from any core routines. [snip] > Ethan, how well developed is the boxed label/text? There are additional options I would like to see added, but as to the size of the bounding box It should be perfect for the terminals that support it at all. > Is this something > that needs more development and better left for a next release? Or > should a proper Qt fix be a simple matter? For me the Qt output is perfect. The bounding box of an object is a fundamental property in Qt. If Dmitri's Qt version is getting it wrong, I'd say that is a serious bug in Qt. I found one bug report against Qt 5.5.1 and 5.6beta that might be relevant, but the text bounding boxes are fine on my machines with Qt 5.4.2 and 5.6.2 Ethan > Dan |