|
From: Daniel J S. <dan...@ie...> - 2003-12-08 02:23:10
|
Hans-Bernhard Broeker wrote: >On Fri, 5 Dec 2003, Daniel J Sebald wrote: > > > >>Did anyone have any ideas for getting the >>width of a line in terms of plot units from the >>terminal? >> >> > >I don't think there is any generic way of doing that. There's an >awful lot of copy-pasted code in the terminal drivers which just has >different variable names, and no generic data structure for internal >variables even for cases like this that could use common basic routines >like "do_linewidth_by_saving_value()" as their term->linewidth() API >implementation. > >It may not even be the case that all relevant drivers _have_ the linewidth >stored in any variable in the first place. PostScript-like ones could >just have written out a postscript command that sets the linewidth and >forgot about it... > >This may need a re-design of at least the arrow-drawing part of the >terminal API to work it out. > I think your assessment is correct. In my opinion, if arrow tips were to be compensated for, it would be nice to have the formula at a high level so that it doesn't need to be implemented multiple times in the various drivers. Perhaps some drivers have an option for where the tip should land. It might be wise to see how they all perform before concluding on the best approach. But it isn't worth doing unless there is some way of addressing the line width issue. Getting back line width information might be tough. However, would it be possible to slightly alter the terminal line command so that the line width is specified in plot units rather than the somewhat arbitrary "1, 2, 3, 4"? It could remain "1 2 3 4" from the users' perspective, but first translate those to plot units before calling the (*term)->linewidth() function. The question then is, will the terminal achieve the specified line width, or will it only approximate it? In the latter case, we are no further along. Dan |