[Xastir] line styles

Tom Russo russo at bogodyn.org
Tue Jan 4 11:34:07 EST 2005


On Tue, Jan 04, 2005 at 10:04:43AM -0600, we recorded a bogon-computron collision of the <jdw at eng.uah.edu> flavor, containing:
> As far as I can tell, there are only 3 line styles available in xastir:
> 
> solid line
> dashed line
> double dashed line
> 
> ... and the last two look almost identical to me.
> 
> I browsed the source code and READMEs and didn't turn up anything else.
> 
> I'd like to see more line styles:
> 
> dot-dash
> dot-dot-long dash
> double line
> "+++++" style line (railroads, etc)
> prety much any line style you'd see on a normal map.
> 
> Do I need educating, or is this a feature request?

Xastir does not do its own line drawing --- it simply passes parameters to
the X11 line-drawing routines.  In X11 there are just the three styles easily
accessible, and they correspond to the 0, 1 and 2 that you can set for 
line_style in dbfawk --- this number is simply passed ito XSetLineAttributes
as the line_style parameter (argument 4).  The integers correspond
to the styles "LineSolid", "LineOnOffDash" and "LineDoubleDash"

There is a way to generate more complex line styles (dot-dot-longdash) with
X calls, but it involves more calls and setting up a data structure to 
encode the pattern.  The call to do that is XSetDashes, and what it does
is reassign a different pattern to one of the three default patterns, at
which point you do an XSetLineAttributes and get that pattern instead.
At this time xastir makes no use of XSetDashes.

To do crosses means you have to do more than just hand off a list of vertices
to X drawing routines.  You'd have to do additional calls to place the crosses,
either as little bit patterns or as a couple of lines.

The short answer, then, is that with some work one could do dot-dash patterned 
lines, but general dot-cross or dot-plus stuff would take more coding effort.  

-- 
Tom Russo    KM5VY     SAR502  DM64ux         http://www.swcp.com/~russo/
Tijeras, NM  QRPL#1592 K2#398  SOC#236 AHTB#1 http://www.qsl.net/~km5vy/
 "When life gives you lemons, find someone with a paper cut."



More information about the Xastir mailing list