File Xaw3d-1.5E-fontset.patch of Package xaw3d
--- AsciiSink.c
+++ AsciiSink.c Tue Sep 21 15:35:46 2004
@@ -532,6 +532,8 @@
{
AsciiSinkObject sink = (AsciiSinkObject) new;
+ if (!sink->ascii_sink.font) XtError("Aborting: no font found\n");
+
GetGC(sink);
sink->ascii_sink.insertCursorOn= CreateInsertCursor(XtScreenOfObject(new));
--- Command.c
+++ Command.c Tue Sep 21 15:35:46 2004
@@ -215,6 +215,8 @@
CommandWidget cbw = (CommandWidget) new;
int shape_event_base, shape_error_base;
+ if (!cbw->label.font) XtError("Aborting: no font found\n");
+
if (cbw->command.shape_style != XawShapeRectangle
&& !XShapeQueryExtension(XtDisplay(new), &shape_event_base,
&shape_error_base))
--- Label.c
+++ Label.c Tue Sep 21 15:37:02 2004
@@ -278,7 +278,10 @@
#ifdef XAW_INTERNATIONALIZATION
if ( lw->simple.international == True ) {
XFontSet fset = lw->label.fontset;
- XFontSetExtents *ext = XExtentsOfFontSet(fset);
+ XFontSetExtents *ext;
+
+ if (!lw->label.fontset || !(ext = XExtentsOfFontSet(fset)))
+ XtError("Aborting: no fontset found\n");
lw->label.label_height = ext->max_ink_extent.height;
if (lw->label.label == NULL) {
@@ -468,6 +471,12 @@
lw->threeD.shadow_width = 0;
#endif
+ if (!lw->label.font) XtError("Aborting: no font found\n");
+#ifdef XAW_INTERNATIONALIZATION
+ if (lw->simple.international && !lw->label.fontset)
+ XtError("Aborting: no fontset found\n");
+#endif
+
if (lw->label.label == NULL)
lw->label.label = XtNewString(lw->core.name);
else
--- List.c
+++ List.c Tue Sep 21 15:41:35 2004
@@ -365,6 +365,12 @@
{
ListWidget lw = (ListWidget) new;
+ if (!lw->list.font) XtError("Aborting: no font found\n");
+#ifdef XAW_INTERNATIONALIZATION
+ if (lw->simple.international && !lw->list.fontset)
+ XtError("Aborting: no fontset found\n");
+#endif
+
/*
* Initialize all private resources.
*/
@@ -589,7 +595,9 @@
int x, y, str_y;
ListWidget lw = (ListWidget) w;
#ifdef XAW_INTERNATIONALIZATION
- XFontSetExtents *ext = XExtentsOfFontSet(lw->list.fontset);
+ XFontSetExtents *ext;
+ if (!lw->list.fontset || !(ext = XExtentsOfFontSet(lw->list.fontset)))
+ XtError("Aborting: no fontset found\n");
#endif
if (!XtIsRealized(w)) return; /* Just in case... */
@@ -968,7 +976,9 @@
ListWidget nl = (ListWidget) new;
Boolean redraw = FALSE;
#ifdef XAW_INTERNATIONALIZATION
- XFontSetExtents *ext = XExtentsOfFontSet(nl->list.fontset);
+ XFontSetExtents *ext;
+ if (!nl->list.fontset || !(ext = XExtentsOfFontSet(nl->list.fontset)))
+ XtError("Aborting: no fontset found\n");
#endif
/* If the request height/width is different, lock it. Unless its 0. If */
--- MultiSink.c
+++ MultiSink.c Tue Sep 21 15:42:47 2004
@@ -253,7 +253,9 @@
XFontSet fontset = sink->multi_sink.fontset;
Position max_x;
Dimension width = XwcTextEscapement(fontset, buf, len);
- XFontSetExtents *ext = XExtentsOfFontSet(fontset);
+ XFontSetExtents *ext;
+ if (!fontset || !(ext = XExtentsOfFontSet(fontset)))
+ XtError("Aborting: no fontset found\n");
max_x = (Position) ctx->core.width;
if ( ((int) width) <= -x) /* Don't draw if we can't see it. */
@@ -290,7 +292,9 @@
MultiSinkObject sink = (MultiSinkObject) w;
Widget source = XawTextGetSource(XtParent(w));
wchar_t buf[BUFSIZ];
- XFontSetExtents *ext = XExtentsOfFontSet(sink->multi_sink.fontset);
+ XFontSetExtents *ext;
+ if (!sink->multi_sink.fontset || !(ext = XExtentsOfFontSet(sink->multi_sink.fontset)))
+ XtError("Aborting: no fontset found\n");
int j, k;
XawTextBlock blk;
@@ -419,8 +423,10 @@
XawTextPosition index, lastPos;
wchar_t c;
- XFontSetExtents *ext = XExtentsOfFontSet(sink->multi_sink.fontset);
XawTextBlock blk;
+ XFontSetExtents *ext;
+ if (!sink->multi_sink.fontset || !(ext = XExtentsOfFontSet(sink->multi_sink.fontset)))
+ XtError("Aborting: no fontset found\n");
/* we may not need this */
lastPos = GETLASTPOS;
@@ -460,8 +466,10 @@
int lastWidth = 0, whiteSpaceWidth = 0;
Boolean whiteSpaceSeen;
wchar_t c;
- XFontSetExtents *ext = XExtentsOfFontSet(sink->multi_sink.fontset);
XawTextBlock blk;
+ XFontSetExtents *ext;
+ if (!sink->multi_sink.fontset || !(ext = XExtentsOfFontSet(sink->multi_sink.fontset)))
+ XtError("Aborting: no fontset found\n");
lastPos = GETLASTPOS;
@@ -565,7 +573,11 @@
MultiSinkObject sink = (MultiSinkObject) new;
GetGC(sink);
-
+
+#ifdef XAW_INTERNATIONALIZATION
+ if (!sink->multi_sink.fontset) XtError("Aborting: no fontset found\n");
+#endif
+
sink->multi_sink.insertCursorOn= CreateInsertCursor(XtScreenOfObject(new));
sink->multi_sink.laststate = XawisOff;
sink->multi_sink.cursor_x = sink->multi_sink.cursor_y = 0;
@@ -652,7 +664,9 @@
{
MultiSinkObject sink = (MultiSinkObject) w;
int font_height;
- XFontSetExtents *ext = XExtentsOfFontSet(sink->multi_sink.fontset);
+ XFontSetExtents *ext;
+ if (!sink->multi_sink.fontset || !(ext = XExtentsOfFontSet(sink->multi_sink.fontset)))
+ XtError("Aborting: no fontset found\n");
font_height = ext->max_logical_extent.height;
return( ((int) height) / font_height );
@@ -679,7 +693,9 @@
#endif
{
MultiSinkObject sink = (MultiSinkObject) w;
- XFontSetExtents *ext = XExtentsOfFontSet(sink->multi_sink.fontset);
+ XFontSetExtents *ext;
+ if (!sink->multi_sink.fontset || !(ext = XExtentsOfFontSet(sink->multi_sink.fontset)))
+ XtError("Aborting: no fontset found\n");
return(lines * ext->max_logical_extent.height);
}
@@ -775,7 +791,9 @@
#endif
{
MultiSinkObject sink = (MultiSinkObject) ((TextWidget)w)->text.sink;
- XFontSetExtents *ext = XExtentsOfFontSet( sink->multi_sink.fontset );
+ XFontSetExtents *ext;
+ if (!sink->multi_sink.fontset || !(ext = XExtentsOfFontSet( sink->multi_sink.fontset )))
+ XtError("Aborting: no fontset found\n");
_XawTextPosToXY( w, pos, x, y );
*y += abs( ext->max_logical_extent.y );
--- SmeBSB.c
+++ SmeBSB.c Tue Sep 21 15:35:46 2004
@@ -203,6 +203,8 @@
else
entry->sme_bsb.label = XtNewString( entry->sme_bsb.label );
+ if (!entry->sme_bsb.font) XtError("Aborting: no font found\n");
+
CreateGCs(new);
GetBitmapInfo(new, TRUE); /* Left Bitmap Info */
--- Tip.c
+++ Tip.c Tue Sep 21 15:43:50 2004
@@ -252,6 +252,12 @@
TipWidget tip = (TipWidget)w;
XGCValues values;
+ if (!tip->tip.font) XtError("Aborting: no font found\n");
+#ifdef XAW_INTERNATIONALIZATION
+ if (tip->tip.international && !tip->tip.fontset)
+ XtError("Aborting: no fontset found\n");
+#endif
+
tip->tip.timer = 0;
values.foreground = tip->tip.foreground;
@@ -344,7 +350,10 @@
#ifdef XAW_INTERNATIONALIZATION
if (tip->tip.international == True) {
Position ksy = tip->tip.internal_height;
- XFontSetExtents *ext = XExtentsOfFontSet(tip->tip.fontset);
+ XFontSetExtents *ext;
+
+ if (!tip->tip.fontset || !(ext = XExtentsOfFontSet(tip->tip.fontset)))
+ XtError("Aborting: no fontset found\n");
ksy += abs(ext->max_ink_extent.y);
@@ -429,7 +438,10 @@
#ifdef XAW_INTERNATIONALIZATION
if (info->tip->tip.international == True) {
XFontSet fset = info->tip->tip.fontset;
- XFontSetExtents *ext = XExtentsOfFontSet(fset);
+ XFontSetExtents *ext;
+
+ if (!fset || !(ext = XExtentsOfFontSet(fset)))
+ XtError("Aborting: no fontset found\n");
height = ext->max_ink_extent.height;
if ((nl = index(label, '\n')) != NULL) {
--- XawIm.c
+++ XawIm.c Tue Sep 21 15:47:29 2004
@@ -752,8 +752,10 @@
SetVaArg( &pe_a[pe_cnt], (XPointer) p->font_set); pe_cnt++;
SetVaArg( &st_a[st_cnt], (XPointer) XNFontSet); st_cnt++;
SetVaArg( &st_a[st_cnt], (XPointer) p->font_set); st_cnt++;
- height = maxAscentOfFontSet(p->font_set)
- + maxDescentOfFontSet(p->font_set);
+ if (p->font_set) {
+ height = maxAscentOfFontSet(p->font_set)
+ + maxDescentOfFontSet(p->font_set);
+ }
height = SetVendorShellHeight(ve, height);
}
if (p->flg & CIFg) {
@@ -884,7 +886,7 @@
XPointer ic_a[20], pe_a[20], st_a[20];
int ic_cnt = 0, pe_cnt = 0, st_cnt = 0;
XawTextMargin *margin;
- int height;
+ int height = 0;
if ((ve->im.xim == NULL) || ((p = GetIcTableShared(w, ve)) == NULL) ||
(p->xic == NULL)) return;
@@ -911,8 +913,10 @@
SetVaArg( &pe_a[pe_cnt], (XPointer) p->font_set); pe_cnt++;
SetVaArg( &st_a[st_cnt], (XPointer) XNFontSet); st_cnt++;
SetVaArg( &st_a[st_cnt], (XPointer) p->font_set); st_cnt++;
- height = maxAscentOfFontSet(p->font_set)
- + maxDescentOfFontSet(p->font_set);
+ if (p->font_set) {
+ height = maxAscentOfFontSet(p->font_set)
+ + maxDescentOfFontSet(p->font_set);
+ }
height = SetVendorShellHeight(ve, height);
}
if (p->flg & CIFg) {