1 /************************************<+>*************************************
2 ****************************************************************************
8 ** Description: Controls the Dtstyle Font dialog
11 ** (c) Copyright Hewlett-Packard Company, 1990.
15 ****************************************************************************
16 ************************************<+>*************************************/
17 /* $XConsortium: Font.c /main/7 1996/10/30 11:14:15 drk $ */
19 /*+++++++++++++++++++++++++++++++++++++++*/
21 /*+++++++++++++++++++++++++++++++++++++++*/
24 #include <Xm/MwmUtil.h>
28 #include <Xm/MessageB.h>
31 #include <Xm/LabelG.h>
36 #include <Xm/VendorSEP.h>
38 #include <Dt/DialogBox.h>
40 #include <Dt/TitleBox.h>
42 #include <Dt/Message.h>
43 #include <Dt/SessionM.h>
44 #include <Dt/HourGlass.h>
49 #include "SaveRestore.h"
51 /*+++++++++++++++++++++++++++++++++++++++*/
53 /*+++++++++++++++++++++++++++++++++++++++*/
55 #define FONT_MSG ((char *)GETMESSAGE(5, 23, "Style Manager - Font"))
56 #define PREVIEW ((char *)GETMESSAGE(5, 17, "Preview"))
57 #define IMMEDIATE ((char *)GETMESSAGE(5, 18, "The changes to fonts will show up in some\napplications the next time they are started.\nOther applications, such as file manager and\napplication manager, will not show the font\nchanges until you Exit the desktop and then log\nback in."))
58 #define LATER ((char *)GETMESSAGE(5, 19, "The selected font will be used when\n you restart this session."))
59 #define INFO_MSG ((char *)GETMESSAGE(5, 24, "The font that is currently used for your desktop is not\navailable in the Size list. If a new font is selected and\napplied, you will not be able to return to the current font\nusing the Style Manager - Font dialog."))
60 #define SYSTEM_MSG ((char *)GETMESSAGE(5, 20, "AaBbCcDdEeFfGg0123456789"))
61 #define USER_MSG ((char *)GETMESSAGE(5, 21, "AaBbCcDdEeFfGg0123456789"))
63 #define SIZE ((char *)GETMESSAGE(5, 22, "Size"))
66 /*+++++++++++++++++++++++++++++++++++++++*/
67 /* Internal Variables */
68 /*+++++++++++++++++++++++++++++++++++++++*/
79 int originalFontIndex;
80 int selectedFontIndex;
81 String selectedFontStr;
82 Boolean userTextChanged;
86 static saveRestore save = {FALSE, 0, };
88 /*+++++++++++++++++++++++++++++++++++++++*/
89 /* Internal Functions */
90 /*+++++++++++++++++++++++++++++++++++++++*/
93 static void CreateFontDlg(
95 static void _DtmapCB_fontBB(
97 XtPointer client_data,
98 XtPointer call_data) ;
101 XtPointer client_data,
102 XtPointer call_data) ;
103 static void changeSampleFontCB(
105 XtPointer client_data,
106 XtPointer call_data) ;
107 static void valueChangedCB(
109 XtPointer client_data,
110 XtPointer call_data) ;
113 /*+++++++++++++++++++++++++++++++++++++++*/
115 /*+++++++++++++++++++++++++++++++++++++++*/
120 if (style.fontDialog == NULL) {
121 _DtTurnOnHourGlass(shell);
122 CreateFontDlg(shell);
123 XtManageChild(style.fontDialog);
124 _DtTurnOffHourGlass(shell);
126 XtManageChild(style.fontDialog);
127 raiseWindow(XtWindow(XtParent(style.fontDialog)));
130 /* If no font is found to match current Desktop
131 font, pop up informative message */
132 if (font.selectedFontIndex < 0)
133 InfoDialog(INFO_MSG, style.shell, False);
136 /*+++++++++++++++++++++++++++++++++++++++*/
138 /*+++++++++++++++++++++++++++++++++++++++*/
149 XmString button_string[NUM_LABELS];
152 Widget widget_list[6];
154 XmStringTable selectedSize;
156 Dimension fontheight;
159 font.selectedFontStr = style.xrdb.systemFontStr;
161 /* Assume nothing is selected */
162 font.selectedFontIndex = -1;
165 * The following flag is used to determine if the user has
166 * entered anything into the sample user font field. If
167 * he does, than when the font selection is changed, the
168 * default message "aAbBcC..." won't be displayed overwriting
169 * the user's text, only the fontlist will be changed.
170 * This flag will be set in the valueChanged callback for the
171 * font.sizeList widget.
173 font.userTextChanged = FALSE;
176 * Look for the selectedFont in the fontChoice array and set
177 * selectedFontIndex to that entry
179 for (i=0; i<style.xrdb.numFonts; i++)
180 if (strcmp (font.selectedFontStr,
181 style.xrdb.fontChoice[i].sysStr) == 0)
183 font.selectedFontIndex = i;
184 if (!style.xrdb.fontChoice[i].userFont)
185 GetUserFontResource(i);
186 if (!style.xrdb.fontChoice[i].sysFont)
187 GetSysFontResource(i);
192 * Save the index of the originally selected font. If no
193 * font is selected, this value will remain -1.
195 font.originalFontIndex = font.selectedFontIndex;
197 /* Set up button labels. */
198 button_string[0] = CMPSTR(_DtOkString);
199 button_string[1] = CMPSTR(_DtCancelString);
200 button_string[2] = CMPSTR(_DtHelpString);
202 /* Create toplevel DialogBox */
204 * Note that save.poscnt has been initialized elsewhere.
205 * save.posArgs may contain information from restoreFont().
208 XtSetArg(save.posArgs[save.poscnt], XmNallowOverlap, False); save.poscnt++;
209 XtSetArg(save.posArgs[save.poscnt], XmNdefaultPosition, False);
211 XtSetArg(save.posArgs[save.poscnt], XmNbuttonCount, NUM_LABELS);
213 XtSetArg(save.posArgs[save.poscnt], XmNbuttonLabelStrings, button_string);
216 __DtCreateDialogBoxDialog(parent, "Fonts", save.posArgs, save.poscnt);
217 XtAddCallback(style.fontDialog, XmNcallback, ButtonCB, NULL);
218 XtAddCallback(style.fontDialog, XmNmapCallback, _DtmapCB_fontBB,
220 XtAddCallback(style.fontDialog, XmNhelpCallback,
221 (XtCallbackProc)HelpRequestCB, (XtPointer)HELP_FONT_DIALOG);
223 XmStringFree(button_string[0]);
224 XmStringFree(button_string[1]);
225 XmStringFree(button_string[2]);
227 widget_list[0] = _DtDialogBoxGetButton(style.fontDialog,2);
229 XtSetArg(args[n], XmNautoUnmanage, False); n++;
230 XtSetArg(args[n], XmNcancelButton, widget_list[0]); n++;
231 XtSetValues (style.fontDialog, args, n);
234 XtSetArg(args[n], XmNtitle, FONT_MSG); n++;
235 XtSetArg (args[n], XmNuseAsyncGeometry, True); n++;
236 XtSetArg(args[n], XmNmwmFunctions, DIALOG_MWM_FUNC); n++;
237 XtSetValues (XtParent(style.fontDialog), args, n);
240 XtSetArg (args[n], XmNchildType, XmWORK_AREA); n++;
241 XtSetArg(args[n], XmNhorizontalSpacing, style.horizontalSpacing); n++;
242 XtSetArg(args[n], XmNverticalSpacing, style.verticalSpacing); n++;
243 XtSetArg(args[n], XmNallowOverlap, False); n++;
244 font.fontWkarea = XmCreateForm(style.fontDialog, "fontWorkArea", args, n);
247 XtSetArg(args[n], XmNtopAttachment, XmATTACH_FORM); n++;
248 XtSetArg(args[n], XmNtopOffset, style.verticalSpacing); n++;
249 XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM); n++;
251 XtSetArg(args[n], XmNfillMode, XmFILL_SELF); n++;
252 XtSetArg(args[n], XmNbehavior, XmICON_LABEL); n++;
253 XtSetArg(args[n], XmNpixmapForeground, style.secBSCol); n++;
254 XtSetArg(args[n], XmNpixmapBackground, style.secTSCol); n++;
255 XtSetArg(args[n], XmNstring, NULL); n++;
256 XtSetArg(args[n], XmNshadowThickness, 0); n++;
257 XtSetArg(args[n], XmNimageName, FONT_ICON); n++;
258 XtSetArg(args[n], XmNtraversalOn, False); n++;
259 widget_list[count++] = font.fontpictLabel =
260 _DtCreateIcon(font.fontWkarea, "fontpictLabel", args, n);
262 /* Create a TitleBox and Scale/List to choose the font size */
265 string = CMPSTR(SIZE);
266 XtSetArg(args[n], XmNtitleString, string); n++;
267 XtSetArg(args[n], XmNtopAttachment, XmATTACH_WIDGET); n++;
268 XtSetArg(args[n], XmNtopWidget, font.fontpictLabel); n++;
269 XtSetArg(args[n], XmNtopOffset, style.verticalSpacing+5); n++;
270 XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM); n++;
271 XtSetArg(args[n], XmNleftOffset, style.horizontalSpacing); n++;
272 XtSetArg(args[n], XmNbottomAttachment, XmATTACH_FORM); n++;
273 widget_list[count++] = font.sizeTB =
274 _DtCreateTitleBox(font.fontWkarea, "sizeTB", args, n);
275 XmStringFree(string);
277 /* calculate size for each of the fonts based on system font size */
279 sizeItems = (XmString *) XtMalloc(sizeof(XmString) * style.xrdb.numFonts);
280 for (n=0; n<style.xrdb.numFonts; n++)
282 sprintf(sizeStr, "%d", (int)(n+1));
283 sizeItems[n] = CMPSTR(sizeStr);
284 style.xrdb.fontChoice[n].pointSize = CMPSTR(sizeStr);
289 XtSetArg (args[n], XmNselectionPolicy, XmBROWSE_SELECT); n++;
290 XtSetArg (args[n], XmNautomaticSelection, True); n++;
291 XtSetArg (args[n], XmNvisibleItemCount, 7); n++;
292 XtSetArg (args[n], XmNitemCount, style.xrdb.numFonts); n++;
293 XtSetArg (args[n], XmNitems, sizeItems); n++;
296 * If matching font was found for current selection,
297 * display it as selected. Otherwise, don't select
300 if (font.selectedFontIndex >=0) {
301 selectedSize = &(style.xrdb.fontChoice[font.selectedFontIndex].pointSize);
302 XtSetArg (args[n], XmNselectedItems, selectedSize); n++;
303 XtSetArg (args[n], XmNselectedItemCount, 1); n++;
305 font.sizeList = XmCreateScrolledList(font.sizeTB,"sizeList",args,n);
306 XtAddCallback(font.sizeList, XmNbrowseSelectionCallback,
307 changeSampleFontCB, NULL);
309 /* If a font match was found and selected, then set it's point size. */
310 if (font.selectedFontIndex >=0)
311 XmListSetItem(font.sizeList,
312 style.xrdb.fontChoice[font.selectedFontIndex].pointSize);
313 XtFree((char *)sizeItems);
315 /* preview TitleBox */
317 XtSetArg(args[n], XmNtopAttachment, XmATTACH_WIDGET); n++;
318 XtSetArg(args[n], XmNtopWidget, font.fontpictLabel); n++;
319 XtSetArg(args[n], XmNtopOffset, style.verticalSpacing+5); n++;
320 XtSetArg(args[n], XmNleftAttachment, XmATTACH_WIDGET); n++;
321 XtSetArg(args[n], XmNleftWidget, font.sizeTB); n++;
322 XtSetArg(args[n], XmNrightAttachment, XmATTACH_FORM); n++;
323 XtSetArg(args[n], XmNrightOffset, style.horizontalSpacing); n++;
324 XtSetArg(args[n], XmNbottomAttachment, XmATTACH_FORM); n++;
325 XtSetArg(args[n], XmNbottomOffset, style.verticalSpacing); n++;
326 string = CMPSTR(PREVIEW);
327 XtSetArg(args[n], XmNtitleString, string); n++;
328 widget_list[count++] = font.previewTB =
329 _DtCreateTitleBox(font.fontWkarea, "systemSample", args, n);
330 XmStringFree(string);
332 /*form to contain preview font area*/
335 XmCreateForm(font.previewTB, "previewForm", args, n);
337 /* sample system font */
341 * If a font match was found and selected, then set the fontlist
342 * and the sample string. Otherwise, output a blank message.
344 if (font.selectedFontIndex >=0) {
345 XtSetArg (args[n], XmNfontList,
346 style.xrdb.fontChoice[font.selectedFontIndex].sysFont); n++;
347 string = CMPSTR(SYSTEM_MSG);
349 string = CMPSTR(BLANK_MSG);
351 XtSetArg (args[n], XmNlabelString, string); n++;
352 XtSetArg (args[n], XmNalignment, XmALIGNMENT_BEGINNING); n++;
353 XtSetArg (args[n], XmNtopAttachment, XmATTACH_FORM); n++;
354 XtSetArg (args[n], XmNtopOffset, 2 * style.verticalSpacing); n++;
355 XtSetArg (args[n], XmNleftAttachment, XmATTACH_FORM); n++;
356 XtSetArg (args[n], XmNrightAttachment, XmATTACH_FORM); n++;
357 XtSetArg (args[n], XmNbottomAttachment, XmATTACH_NONE); n++;
359 XmCreateLabelGadget(font.previewForm, "systemSample", args, n);
360 XmStringFree(string);
362 /* sample user font */
365 * If a font match was found and selected, then set the fontlist
366 * and the sample string. Otherwise output a blank message.
368 if (font.selectedFontIndex >=0) {
369 XtSetArg (args[n], XmNfontList,
370 style.xrdb.fontChoice[font.selectedFontIndex].userFont); n++;
371 XtSetArg (args[n], XmNvalue, USER_MSG); n++;
373 XtSetArg (args[n], XmNvalue, NULL); n++;
376 XtSetArg (args[n], XmNtopAttachment, XmATTACH_WIDGET); n++;
377 XtSetArg (args[n], XmNtopWidget, font.systemLabel); n++;
378 XtSetArg (args[n], XmNtopOffset, 2 * style.verticalSpacing); n++;
379 XtSetArg (args[n], XmNleftAttachment, XmATTACH_OPPOSITE_WIDGET); n++;
380 XtSetArg (args[n], XmNleftWidget, font.systemLabel); n++;
381 XtSetArg (args[n], XmNbottomAttachment, XmATTACH_NONE); n++;
382 XtSetArg (args[n], XmNrightAttachment, XmATTACH_OPPOSITE_WIDGET); n++;
383 XtSetArg (args[n], XmNrightWidget, font.systemLabel); n++;
385 XmCreateText(font.previewForm, "userText", args, n);
386 /* Add callback to determine if user changes text in sample field */
387 XtAddCallback(font.userText, XmNvalueChangedCallback, valueChangedCB, NULL);
389 XtManageChild(font.systemLabel);
390 XtManageChild(font.userText);
391 XtManageChild(font.previewForm);
392 XtManageChild(font.sizeList);
393 XtManageChildren(widget_list,count);
394 XtManageChild(font.fontWkarea);
399 /*+++++++++++++++++++++++++++++++++++++++*/
400 /* _DtmapCB_fontBB */
401 /*+++++++++++++++++++++++++++++++++++++++*/
405 XtPointer client_data,
406 XtPointer call_data )
409 DtWsmRemoveWorkspaceFunctions(style.display, XtWindow(XtParent(w)));
411 if (!save.restoreFlag)
412 putDialog ((Widget)client_data, w);
414 XmTextShowPosition(font.userText, 0);
416 XtRemoveCallback(style.fontDialog, XmNmapCallback, _DtmapCB_fontBB, NULL);
421 /*+++++++++++++++++++++++++++++++++++++++++++++++++*/
423 /* Process callback from PushButtons in DialogBox. */
424 /*+++++++++++++++++++++++++++++++++++++++++++++++++*/
428 XtPointer client_data,
429 XtPointer call_data )
431 DtDialogBoxCallbackStruct *cb
432 = (DtDialogBoxCallbackStruct *) call_data;
434 char *str, *fntstr, *fntsetstr;
438 switch (cb->button_position)
440 /* Set the xrdb or pass to dtsession and close the window */
443 * Need to test for the case where the Font dialog maps without
444 * any fonts selected, and the user presses OK. Do this by
445 * checking for number of items selected before changing
448 XtVaGetValues (font.sizeList, XmNselectedItemCount, &items, NULL);
450 /* Post an info dialog explaining when the new fonts will appear */
451 if ((font.selectedFontIndex != font.originalFontIndex) && (items > 0))
453 XtUnmanageChild(style.fontDialog);
455 if(style.xrdb.writeXrdbImmediate)
457 InfoDialog(IMMEDIATE, style.shell, False);
461 InfoDialog(LATER, style.shell, False);
465 for *FontSet resource: find first font entry delimited by a ":"
468 len =strcspn(style.xrdb.fontChoice[font.selectedFontIndex].userStr,
470 fntsetstr = (char *) XtCalloc(1, len + 1);
472 style.xrdb.fontChoice[font.selectedFontIndex].userStr,
476 Since the *Font and *FontSet resources may be used by old
477 X applications, a fontlist of multiple fonts must be converted
478 to Xt font set format (';'s converted to ','s since many old X
479 apps don't understand ';' syntax.)
481 str = strstr(fntsetstr,";");
484 str = strstr(str,";");
488 for *Font resource: find first font entry delimited by a comma,
491 len = strcspn(fntsetstr,",:=");
492 fntstr = (char *) XtCalloc(1, len + 1);
494 style.xrdb.fontChoice[font.selectedFontIndex].userStr,
498 for *FontSet resource: if we got a font (instead of a font set)
499 from the first entry, then wildcard its charset fields
501 len = strlen(fntsetstr);
502 if (style.xrdb.fontChoice[font.selectedFontIndex].userStr[len]
504 str = strchr(fntsetstr, '-');
505 for (n = 1; n < 13 && str; n++)
506 str = strchr(str + 1, '-');
508 strcpy(str + 1, "*-*");
511 /* create the font resource specs with the selected font for xrdb */
513 "*systemFont: %s\n*userFont: %s\n*FontList: %s\n*buttonFontList: %s\n*labelFontList: %s\n*textFontList: %s\n*XmText*FontList: %s\n*XmTextField*FontList: %s\n*DtEditor*textFontList: %s\n*Font: %s\n*FontSet: %s\n",
514 style.xrdb.fontChoice[font.selectedFontIndex].sysStr,
515 style.xrdb.fontChoice[font.selectedFontIndex].userStr,
516 style.xrdb.fontChoice[font.selectedFontIndex].sysStr,
517 style.xrdb.fontChoice[font.selectedFontIndex].sysStr,
518 style.xrdb.fontChoice[font.selectedFontIndex].sysStr,
519 style.xrdb.fontChoice[font.selectedFontIndex].userStr,
520 style.xrdb.fontChoice[font.selectedFontIndex].userStr,
521 style.xrdb.fontChoice[font.selectedFontIndex].userStr,
522 style.xrdb.fontChoice[font.selectedFontIndex].userStr,
528 /* if writeXrdbImmediate true write to Xrdb else send to session mgr */
529 if(style.xrdb.writeXrdbImmediate)
530 _DtAddToResource(style.display,fontres);
532 SmNewFontSettings(fontres);
534 font.originalFontIndex = font.selectedFontIndex;
535 style.xrdb.systemFontStr = font.selectedFontStr;
539 XtUnmanageChild(style.fontDialog);
545 /* reset preview area fonts to original and close the window*/
547 XtUnmanageChild(style.fontDialog);
549 if (font.originalFontIndex >= 0)
550 XmListSelectPos(font.sizeList, font.originalFontIndex+1, True);
553 * if no font was originally selected, need to undo any results
554 * from selections that were made by user before pressing Cancel.
556 XtVaSetValues (font.sizeList, XmNselectedItemCount, 0, NULL);
557 XtVaSetValues (font.userText,
559 XmNfontList, style.xrdb.userFont,
561 XtVaSetValues (font.systemLabel,
562 XmNlabelString, CMPSTR(BLANK_MSG),
563 XmNfontList, style.xrdb.systemFont,
565 font.userTextChanged = FALSE;
566 font.selectedFontIndex = -1;
571 XtCallCallbacks(style.fontDialog, XmNhelpCallback, (XtPointer)NULL);
580 /*+++++++++++++++++++++++++++++++++++++++*/
581 /* changSampleFontCB */
582 /* Change the font in the sample areas */
583 /*+++++++++++++++++++++++++++++++++++++++*/
587 XtPointer client_data,
588 XtPointer call_data )
594 XmListCallbackStruct *cb = (XmListCallbackStruct *) call_data;
596 pos = cb->item_position-1;
598 font.selectedFontIndex = pos;
599 font.selectedFontStr = style.xrdb.fontChoice[pos].sysStr;
601 hourGlassOn = !style.xrdb.fontChoice[pos].userFont ||
602 !style.xrdb.fontChoice[pos].sysFont;
605 _DtTurnOnHourGlass(style.fontDialog);
607 if (!style.xrdb.fontChoice[pos].userFont)
608 GetUserFontResource(pos);
609 if (!style.xrdb.fontChoice[pos].sysFont)
610 GetSysFontResource(pos);
613 _DtTurnOffHourGlass(style.fontDialog);
615 /* Set the sample System Font string to different Font */
617 XtSetArg(args[n], XmNfontList, style.xrdb.fontChoice[pos].sysFont); n++;
618 /* string_val = CMPSTR(SYSTEM_MSG);*/
619 XtSetArg (args[n], XmNlabelString, CMPSTR(SYSTEM_MSG)); n++;
620 XtSetValues (font.systemLabel, args, n);
623 * If the user didn't change the text field, output standard user
627 if (!font.userTextChanged)
628 XtSetArg (args[n], XmNvalue, USER_MSG); n++;
629 XtSetArg(args[n], XmNfontList, style.xrdb.fontChoice[pos].userFont); n++;
630 XtSetValues (font.userText, args, n);
631 XmTextShowPosition(font.userText, 0);
634 /*+++++++++++++++++++++++++++++++++++++++*/
636 /* Set flag indicating that the user */
637 /* text field has been modified. */
638 /*+++++++++++++++++++++++++++++++++++++++*/
642 XtPointer client_data,
643 XtPointer call_data )
646 font.userTextChanged = TRUE;
649 /************************************************************************
652 * restore any state information saved with saveFonts.
653 * This is called from restoreSession with the application
654 * shell and the special xrm database retrieved for restore.
655 ************************************************************************/
662 XrmRepresentation rep_type;
665 xrm_name [0] = XrmStringToQuark ("Fonts");
669 xrm_name [1] = XrmStringToQuark ("x");
670 if (XrmQGetResource (db, xrm_name, xrm_name, &rep_type, &value)){
671 XtSetArg (save.posArgs[save.poscnt], XmNx, atoi((char *)value.addr));
673 save.restoreFlag = True;
677 xrm_name [1] = XrmStringToQuark ("y");
678 if (XrmQGetResource (db, xrm_name, xrm_name, &rep_type, &value)){
679 XtSetArg (save.posArgs[save.poscnt], XmNy, atoi((char *)value.addr));
683 xrm_name [1] = XrmStringToQuark ("ismapped");
684 XrmQGetResource (db, xrm_name, xrm_name, &rep_type, &value);
685 /* Are we supposed to be mapped? */
686 if (strcmp(value.addr, "True") == 0)
690 /************************************************************************
693 * This routine will write out to the passed file descriptor any state
694 * information this dialog needs. It is called from saveSessionCB with the
695 * file already opened.
696 * All information is saved in xrm format. There is no restriction
697 * on what can be saved. It doesn't have to be defined or be part of any
698 * widget or Xt definition. Just name and save it here and recover it in
699 * restoreFonts. The suggested minimum is whether you are mapped, and your
701 ************************************************************************/
707 char *bufr = style.tmpBigStr; /* size=[1024], make bigger if needed */
708 XmVendorShellExtObject vendorExt;
709 XmWidgetExtData extData;
711 if (style.fontDialog != NULL) {
712 if (XtIsManaged(style.fontDialog))
713 sprintf(bufr, "*Fonts.ismapped: True\n");
715 sprintf(bufr, "*Fonts.ismapped: False\n");
717 /* Get and write out the geometry info for our Window */
719 x = XtX(XtParent(style.fontDialog));
720 y = XtY(XtParent(style.fontDialog));
722 /* Modify x & y to take into account window mgr frames
723 * This is pretty bogus, but I don't know a better way to do it.
725 extData = _XmGetWidgetExtData(style.shell, XmSHELL_EXTENSION);
726 vendorExt = (XmVendorShellExtObject)extData->widget;
727 x -= vendorExt->vendor.xOffset;
728 y -= vendorExt->vendor.yOffset;
730 sprintf(bufr, "%s*Fonts.x: %d\n", bufr, x);
731 sprintf(bufr, "%s*Fonts.y: %d\n", bufr, y);
733 write (fd, bufr, strlen(bufr));