[Xastir] change station font

Curt Mills, WE7U archer at eskimo.com
Sat May 24 02:23:21 EDT 2003


On 23 May 2003, Chris Hare wrote:

> I am a little visually challenged and I would like to change the font
> size on the stations displayed in xastir.  Is that possible?

I have a temporary solution.  Take this file attachment and put it
into your xastir directory.  On mine it'd be /home/<user>/src/xastir/
Name it "bigfont.patch".

Don't do the other change I suggested.  It's included in this patch.
If you've already done it, you can delete the main.c file and then
run "cvs update" to get the original file back again, assuming that
you're running Xastir CVS and not a snapshot release.

Run these commands:

	cd src/xastir
	patch -p0 <bigfont.patch
	make
	su
	make install-strip
	chmod 4555 /usr/local/bin/xastir
	exit

When you start Xastir, you might want want to change your
Maps->Station Text Style to "Black Border".  The background colors
for the other two possibilities were outgrown by the font I chose.

I see a few minor glitches here and there with how some of the
dialogs are constructed, made obvious by the much larger font.  I
also see one dialog that is glaringly incorrect (Audio Config), so
I'll try to fix that one up tomorrow.

Let me know if anything's unusable because of the larger fonts.

Curt, WE7U.				archer at eskimo.com
http://www.eskimo.com/~archer
  Lotto:  A tax on people who are bad at math. - unknown
Windows:  Microsoft's tax on computer illiterates. - WE7U.
The world DOES revolve around me:  I picked the coordinate system!"
-------------- next part --------------
Index: src/draw_symbols.c
===================================================================
RCS file: /cvsroot/xastir/xastir/src/draw_symbols.c,v
retrieving revision 1.38
diff -w -u -r1.38 draw_symbols.c
--- src/draw_symbols.c	21 May 2003 23:16:19 -0000	1.38
+++ src/draw_symbols.c	24 May 2003 06:46:40 -0000
@@ -81,11 +81,18 @@
  *  Draw nice looking text
  */
 void draw_nice_string(Widget w, Pixmap where, int style, long x, long y, char *text, int bgcolor, int fgcolor, int length) {
+    XFontStruct *font = NULL;
+    char fonttext[40] = "-*-*-*-*-*-*-20-*-*-*-*-*-*-*";
+    
+
+    font = (XFontStruct *)XLoadQueryFont(XtDisplay(w), fonttext);
+    XSetFont(XtDisplay(w), gc, font->fid);
 
     switch (style) {
         case 0:
             // make outline style
             (void)XSetForeground(XtDisplay(w),gc,colors[bgcolor]);
+
             // draw an outline 1 pixel bigger than text
             (void)XDrawString(XtDisplay(w),where,gc,x+1,y-1,text,length);
             (void)XDrawString(XtDisplay(w),where,gc,x+1,y,text,length);
Index: src/main.c
===================================================================
RCS file: /cvsroot/xastir/xastir/src/main.c,v
retrieving revision 1.286
diff -w -u -r1.286 main.c
--- src/main.c	23 May 2003 19:06:18 -0000	1.286
+++ src/main.c	24 May 2003 06:48:56 -0000
@@ -21884,6 +21884,8 @@
     // Look at files in /usr/X11/lib/X11/app-defaults for ideas.
     String fallback_resources[] = {
 
+        "*.fontList: -*-*-*-*-*-*-20-*-*-*-*-*-*-*\n",
+
         "*initialResourcesPersistent: False\n",
 
         "*List.Translations: #override \n\


More information about the Xastir mailing list