|
From: Allin C. <cot...@wf...> - 2012-10-13 00:09:26
|
On Fri, 12 Oct 2012, Ethan A Merritt wrote: > On Friday, October 12, 2012 11:27:20 am pl...@pi... wrote: >>> - font-size="8pt" requests an 8 point font regardless of the >>> display resolution or current scaling. That's what gnuplot does. >>> In theory, if you view an SVG document in a viewer that allows >>> you to rescale the figure, the font should display as the same >>> size even after rescaling the plot. That is, if you shrink the >>> figure the font does not shrink with it. >> >> Not what I am finding in practise. > > Right. Me neither. So theory and practice diverge once again. > Nevertheless, writing the same SVG text element twice, > once with font-size="10pt" and once with font-size="10" is > quite informative about the substantial difference between the > two descriptions. > > I think I will change the svg terminal to omit units from the > font-size attribute, bringing it into line with what inkscape > does. I am left rather confused about the level of device > dependence, but at least on typical terminal screens (90-100dpi) > this makes gnuplot's string width estimates much more accurate. This sounds promising. One further thought: what about using a temporary pango layout to size the text, with the same font name/size specification? This won't necessarily work well in all cases, but I guess that in many cases the visual rendering of an SVG file will in the end depend on cairo and pango, so laying out the text via pango, in RAM, would give a reasonable approximation to the size as actually seen. Even if not always right, surely better than the current vague guess? I haven't checked yet, but I presume this is what the pngcairo and pdfcairo drivers do at present, and their text placement is fine. Allin Cottrell |