|
/*
If I attempt to specify a font such as "8x13", no text is written
into the window.
I however I change it to "fixed", text appears. This appears to
be a feature of UWS2.2.....2.1 handled either case.
Bug? or feature?
*/
#include <stdio.h>
#include <X11/DECwDwtWidgetProg.h>
#define GW_XORG 0
#define GW_YORG 0
#define GW_WIDTH 800
#define GW_HEIGHT 650
#define TW_XORG GW_XORG
#define TW_YORG GW_YORG
#define TW_WIDTH GW_WIDTH
#define TW_HEIGHT GW_HEIGHT
/* Global Variables */
static char text_title[] = "Text Window";
/* Text buffers */
#define MAXTEXTBUF 2048
struct text_info {
DwtFontList tx_font_list; /* current text font */
char *tx_buffer; /* display text for text screen */
int buf_size; /* rows * cols chars */
int tx_cur_len; /* length of text buffer */
int tx_new_line; /* inserting new line flag */
int tx_start_line; /* address of start of current line */
int tx_ins_pos; /* next output character position */
int tx_cur_line; /* start of current line */
int tx_char_wdt, tx_char_hgt; /* character height and width */
int tx_cols, tx_rows; /* cols & rows in text widget */
};
static struct text_info *text;
static void create_text_window();
Widget text_frame, text_main, text_window;
XFontStruct *graph_font;
Display *display;
Visual *visual;
Screen *screen;
XtAppContext context;
main(argc, argv)
int argc;
char **argv;
{
Arg arglist[30];
int count, i, fdr;
/* Init toolkit, open root window */
XtToolkitInitialize();
context = XtCreateApplicationContext();
display = XtOpenDisplay(context,NULL,"Test","Test",NULL,0,&argc,argv);
/* this works */
/*graph_font = XLoadQueryFont(display,"fixed");*/
/* this doesn't */
graph_font = XLoadQueryFont(display,"8x13");
/* Create text window */
create_text_window();
/* manage, realize widgets */
XtManageChild(text_window);
XtManageChild(text_main);
XtRealizeWidget(text_frame);
/* Handoff to event handlers */
XtAppMainLoop(context);
}
static void create_text_window()
{
Arg arglist[20];
int count;
text_frame = XtAppCreateShell(text_title,"AutoCad",
applicationShellWidgetClass,display,NULL,0);
text_main = DwtMainWindow(text_frame,"TextMainWindow",0, 0,
TW_WIDTH, TW_HEIGHT, NULL);
/* allocate text buffer for text window */
text = (struct text_info *) XtMalloc(sizeof(struct text_info));
text->tx_buffer = (char *) XtMalloc(MAXTEXTBUF);
text->tx_buffer[0] = '\0';
text->tx_ins_pos = 0;
text->tx_cur_len = 0;
text->tx_cur_line = 0;
strcpy(text->tx_buffer,"this is a test message....this is a test message....this is a test message");
/* specify the ISO Latin1 charset */
text->tx_font_list = DwtCreateFontList(graph_font, 1);
/* build the text widget */
count = 0;
XtSetArg(arglist[count],DwtNscrollVertical,TRUE); count++;
XtSetArg(arglist[count],DwtNresizeWidth,FALSE);count++;
XtSetArg(arglist[count],DwtNresizeHeight,FALSE);count++;
XtSetArg(arglist[count],DwtNeditable,FALSE); count++;
XtSetArg(arglist[count],DwtNautoShowInsertPoint,TRUE);count++;
XtSetArg(arglist[count],DwtNinsertionPointVisible,TRUE);count++;
XtSetArg(arglist[count],DwtNwordWrap,TRUE); count++;
XtSetArg(arglist[count],DwtNfont,text->tx_font_list);count++;
XtSetArg(arglist[count],DwtNvalue,text->tx_buffer);count++;
text_window=DwtSTextCreate(text_main,/*MSG0*/"TextWindow",arglist,count);
}
|
| to amplify on .3
The MIT fonts, including 8x13 and about 120 others, are in the
Unsupported X11 Components subset in UWS V2.2 and UWS V4.0.
For many of you out there, that means that they are on a
separate piece of media (along with unspported components
of the ULTRIX base operating system) which is clearly labelled
"Unsupported". For those doing RIS (aka Remote Installations),
the Unsupported subsets are in a separate Product that cannot
be installed until after the supported installation is complete.
Many users, especially those who fail to carefully examine the
rather thick release notes, are unaware of this. It is probably
the single most common source of serious run-time problem reports
from people familiar with previous versions of ULTRIX Worksystem Software.
Of course, this wasn't my idea.
John
|