/*
* FontSB.c
*
* (c) Copyright 1991-1994 Adobe Systems Incorporated.
* All rights reserved.
*
* Permission to use, copy, modify, distribute, and sublicense this software
* and its documentation for any purpose and without fee is hereby granted,
* provided that the above copyright notices appear in all copies and that
* both those copyright notices and this permission notice appear in
* supporting documentation and that the name of Adobe Systems Incorporated
* not be used in advertising or publicity pertaining to distribution of the
* software without specific, written prior permission. No trademark license
* to use the Adobe trademarks is hereby granted. If the Adobe trademark
* "Display PostScript"(tm) is used to describe this software, its
* functionality or for any other purpose, such use shall be limited to a
* statement that this software works in conjunction with the Display
* PostScript system. Proper trademark attribution to reflect Adobe's
* ownership of the trademark shall be given whenever any such reference to
* the Display PostScript system is made.
*
* ADOBE MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THE SOFTWARE FOR
* ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
* ADOBE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
* IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NON- INFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL ADOBE BE LIABLE
* TO YOU OR ANY OTHER PARTY FOR ANY SPECIAL, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER WHETHER IN AN ACTION OF CONTRACT,
* NEGLIGENCE, STRICT LIABILITY OR ANY OTHER ACTION ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ADOBE WILL NOT
* PROVIDE ANY TRAINING OR OTHER SUPPORT FOR THE SOFTWARE.
*
* Adobe, PostScript, and Display PostScript are trademarks of Adobe Systems
* Incorporated which may be registered in certain jurisdictions
*
* Author: Adobe Systems Incorporated
*/
/* $XFree86$ */
#include <stdlib.h>
#include <unistd.h>
#include <ctype.h>
#include <stdio.h>
#include <math.h>
#include <X11/IntrinsicP.h>
#include <X11/StringDefs.h>
/* There are no words to describe how I feel about having to do this */
#if XmVersion > 1001
#include <Xm/ManagerP.h>
#else
#endif
#include <Xm/SeparatoG.h>
#include <Xm/RowColumn.h>
#include <Xm/DrawingA.h>
#include <Xm/MessageB.h>
#include <DPS/dpsXclient.h>
#include "dpsXcommonI.h"
#include <DPS/dpsXcommon.h>
#include <DPS/dpsXshare.h>
#include "FSBwraps.h"
#include "FontSBI.h"
#include <DPS/FontSample.h>
#include <DPS/FontCreato.h>
#include <pwd.h>
/* Turn a string into a compound string */
/* Create a canonical representation of a string, and as a side effect
make sure the string is in permanent storage. This implementation may
not work under all Xlibs */
static float defaultSizeList[] = {
#ifndef DEFAULT_SIZE_LIST
8, 10, 12, 14, 16, 18, 24, 36, 48, 72
#else
#endif /* DEFAULT_SIZE_LIST */
};
#ifndef DEFAULT_SIZE_LIST_COUNT
#endif /* DEFAULT_SIZE_LIST_COUNT */
#ifndef DEFAULT_SIZE
#else
#endif /* DEFAULT_SIZE */
#ifndef DEFAULT_RESOURCE_PATH
#endif /* DEFAULT_RESOURCE_PATH */
#ifndef DEFAULT_MAX_PENDING
#endif /* DEFAULT_MAX_PENDING */
static XtResource resources[] = {
};
/* Forward declarations */
static Boolean ChangeBlends(Widget w, String base_name, String blend_name, FSBBlendAction action, int *axis_values, float *axis_percents);
static Boolean Verify(FontSelectionBoxWidget fsb, FSBValidateCallbackRec *cb, String afm, Boolean doIt);
static XtGeometryResult GeometryManager(Widget w, XtWidgetGeometry *desired, XtWidgetGeometry *allowed);
static void ChangeManaged(Widget w);
static void ClassInitialize(void);
static void FontFamilyFaceBlendToName(Widget w, String family, String face, String blend, String *font_name);
static void FontNameToFamilyFaceBlend(Widget w, String font_name, String *family, String *face, String *blend);
static void FreeFontRec(FontRec *f);
static void GetBlendInfo(Widget w, String name, int *num_axes_return, int *num_designs_return, String **axis_names_return, float **blend_positions_return, int **blend_map_count_return, int **blend_design_coords_return, float **blend_normalized_coords_return);
static void GetBlendList(Widget w, String name, int *count_return, String **blend_return, String **font_name_return, float **axis_values_return);
static void GetFaceList(Widget w, String family, int *count, String **face_list, String **font_list);
static void GetTextDimensions(Widget w, String text, String font, double size, double x, double y, float *dx, float *dy, float *left, float *right, float *top, float *bottom);
static void RefreshFontList(Widget w);
static void SetFontFamilyFace(Widget w, String family, String face, Bool family_multiple, Bool face_multiple);
static void SetFontFamilyFaceBlend(Widget w, String family, String face, String blend, Bool family_multiple, Bool face_multiple);
static void UndefUnusedFonts(Widget w);
/* Core class part */
{
/* class_name */ "FontSelectionBox",
/* widget_size */ sizeof(FontSelectionBoxRec),
/* class_initialize */ ClassInitialize,
/* class_part_initialize */ ClassPartInitialize,
/* class_inited */ False,
/* initialize */ Initialize,
/* initialize_hook */ NULL,
/* realize */ XtInheritRealize,
/* actions */ NULL,
/* num_actions */ 0,
/* resources */ resources,
/* xrm_class */ NULLQUARK,
/* compress_motion */ True,
/* compress_exposure */ XtExposeCompressMultiple,
/* compress_enterleave */ True,
/* visible_interest */ False,
/* destroy */ Destroy,
/* resize */ Resize,
/* expose */ NULL,
/* set_values */ SetValues,
/* set_values_hook */ NULL,
/* set_values_almost */ XtInheritSetValuesAlmost,
/* get_values_hook */ NULL,
/* accept_focus */ NULL,
/* version */ XtVersion,
/* callback offsets */ NULL,
/* tm_table */ NULL,
/* query_geometry */ XtInheritQueryGeometry,
/* display_accelerator */ NULL,
/* extension */ NULL,
},
/* Composite class part */
{
/* geometry_manager */ GeometryManager,
/* change_managed */ ChangeManaged,
/* insert_child */ XtInheritInsertChild,
/* delete_child */ XtInheritDeleteChild,
/* extension */ NULL,
},
/* Constraint class part */
{
/* resources */ NULL,
/* num_resources */ 0,
/* constraint_size */ 0,
/* initialize */ NULL,
/* destroy */ NULL,
/* set_values */ NULL,
/* extension */ NULL,
},
/* Manager class part */
{
/* translations */ XtInheritTranslations,
/* syn_resources */ NULL,
/* num_syn_resources */ 0,
/* syn_constraint_resources */ NULL,
/* num_syn_constraint_resources */ 0,
/* parent_process */ XmInheritParentProcess,
/* extension */ NULL,
},
/* FontSelectionBox class part */
{
/* set_font_name */ SetFontName,
/* set_font_family_face */ SetFontFamilyFace,
/* set_font_size */ SetFontSize,
/* refresh_font_list */ RefreshFontList,
/* get_family_list */ GetFamilyList,
/* get_face_list */ GetFaceList,
/* undef_unused_fonts */ UndefUnusedFonts,
/* download_font_name */ DownloadFontName,
/* match_font_face */ MatchFontFace,
/* font_name_to_family_face */ FontNameToFamilyFace,
/* font_family_face_to_name */ FontFamilyFaceToName,
/* find_afm */ FindAFM,
/* find_font_file */ FindFontFile,
/* get_text_dimensions */ GetTextDimensions,
/* set_font_family_face_blend */ SetFontFamilyFaceBlend,
/* font_name_to_family_face_blend */ FontNameToFamilyFaceBlend,
/* font_family_face_blend_to_name */ FontFamilyFaceBlendToName,
/* get_blend_list */ GetBlendList,
/* get_blend_info */ GetBlendInfo,
/* change_blends */ ChangeBlends,
/* extension */ NULL,
}
};
/* ARGSUSED */
{
static float *list;
char save;
if (*num_args != 0) { /* Check for correct number */
"cvtStringToFloatList", "wrongParameters",
"XtToolkitError",
"String to integer list conversion needs no extra arguments",
}
return False;
}
else {
return False;
}
}
for (i = 0; i < count; i++) {
*ch = '\0';
}
}
return True;
}
/* ARGSUSED */
static void FloatListDestructor(
{
}
{
return result;
} else return NULL;
}
{
int countDecimals;
countDecimals = 0;
if (*src == '.') {
if (countDecimals) return False;
else countDecimals++;
}
}
*ch++ = '\0';
return True;
}
{
*ch++ = '\0';
return True;
}
static void ClassInitialize(void)
{
/* Register a converter for string to int list */
}
{
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
"Berkeley", "CaslonFiveForty", "CaslonThree", "GaramondThree",
};
"ITC Berkeley Oldstyle", "Caslon 540", "Caslon 3", "Garamond 3",
};
};
static int missingFoundryLen[] = {
9, 4, 9, 0
};
/* I wish we didn't have to do this! */
static void MungeFontNames(
{
int digits = 0;
int i, diff;
/* Don't make bugFamilies canonical; we'd have to make the initial
family canonical to do anything with it and there's no point in that */
if (!inited) {
for (i = 0; fixedFamilies[i] != NULL; i++) {
}
}
/* Copy the fullname into buf, enforcing one space between words.
Eliminate leading digits and spaces, ignore asterisks, if the
full name ends with 5 digits strip them, and replace periods that
aren't followed by a space with a space. If leading digits are
followed by " pt " skip that too. */
prev = ' ';
while (*src != '\0') {
if (*src == '*') {
src++;
continue;
}
if (*src == '.') {
src++;
continue;
}
else digits = 0;
*dst++ = ' ';
if (prev == ' ') {
src++;
continue;
}
src++;
}
if (digits == 5) {
dst -= 5;
}
*dst = '\0';
/* Stupid Fette Fraktur */
if (name == FetteFrakturDfr) {
} else if (name == LinotextDfr) {
}
}
/* From here on fullname should not be used */
/* Done with the full name; now onto the family */
for (i = 0; bugFamilies[i] != NULL; i++) {
if (diff < 0) break;
if (diff == 0) {
*familyReturn = fixedFamilies[i];
goto FAMILY_DONE;
}
}
/* Copy the family into buf, enforcing one space between words */
prev = ' ';
while (*src != '\0') {
*dst++ = ' ';
if (prev == ' ') {
src++;
continue;
}
src++;
}
*dst = '\0';
/* Compensate for fonts with foundries in the full name but not the
family name by adding to the family name */
for (i = 0; missingFoundries[i] != NULL; i++) {
missingFoundryLen[i]);
if (diff > 0) continue;
missingFoundryLen[i] != 0)) {
dst--;
}
}
break;
}
/* From here on dst no longer points to the end of the buffer */
/* Stupid Helvetica Rounded! */
}
/* From here on family should not be used */
/* Now to find the face in all this */
src = *fullnameReturn;
dst = *familyReturn;
src++;
dst++;
}
else if (*weight != '\0') {
/* Handle Multiple Master fonts */
else {
}
}
"Adobe ", "Bauer ", "Berthold ", "ITC ", "Linotype ",
{
register int i, diff;
key[0] = 'P';
return True;
}
if (diff < 0) break;
if (diff == 0) {
if (i == STEMPELINDEX) {
}
return True;
}
}
return False;
}
{
int count = 0;
while (*buf != '\0') {
if (*buf != '/') return 0;
buf++;
count++;
}
return count;
}
char *buf,
float *blendPos,
{
int i, j = 0;
float f;
*designs = 0;
while (*buf != '\0') {
/* Now there should be *axes positive floats, separated by space */
for (i = 0; i < *axes; i++) {
blendPos[j++] = f;
}
(*designs)++;
}
return False;
}
char *buf,
int *breakCount,
int *blendBreak,
float *blendBreakValue,
int *axes)
{
int i, j = 0;
int n;
float f;
/* OK. What we expect to see here is *axes arrays. Each one contains at
least 2 and no more than 12 subarrays, each of which contains 2 values,
an int and a float */
for (i = 0; i < *axes; i++) {
breakCount[i] = 0;
while (*buf == '[') {
buf++;
/* Now there should be an integer */
blendBreak[j] = n;
/* Now there should be a float */
blendBreakValue[j++] = f;
/* Nothing more in the array */
breakCount[i]++;
}
}
return False;
}
int axes,
char *buf,
char *names[])
{
int i = 0;
/* We expect to see axes names, each optionally preceded with a / and
separated by space */
while (*buf != '\0') {
}
return False;
}
static void GetPSFontInfo(
char *name,
int *axes,
int *designs,
char *axisNames,
float *blendPos,
int *breakCount,
int *blendBreak,
float *blendBreakValue)
{
int entries;
"FontAxes", name,
if (entries < 1) {
*axes = 0;
return;
}
if (*axes == 0) return;
"FontBlendMap", name,
if (entries < 1) {
*axes = 0;
return;
}
*axes = 0;
return;
}
"FontBlendPositions", name,
if (entries < 1) {
*axes = 0;
return;
}
*axes = 0;
return;
}
}
static void AddFontRecord(
int serverNum,
{
FontRec *f;
int i, j, k, n;
/* First see if it's there already */
return;
}
}
}
/* We believe that names gotten from PS resource files have been
pre-munged, so no need to do it again */
if (resident) {
/* Have to get the info from the server */
if (brokenFont) return;
/* Deal with fonts that don't have useful information */
if (family[0] == '\0') {
if (fullname[0] == '\0') {
if (blendedFont) {
if (brokenFont) axes = 0;
} else axes = 0;
} else {
}
/* We didn't get an exact match, go for family match */
}
ff->font_count = 0;
ff->blend_count = 0;
}
f->full_name = fullnameReturn;
f->temp_resident = False;
f->in_font_creator = False;
f->pending_delete_next = NULL;
f->face_name = faceReturn;
f->blend_count = 0;
BlendDataRec *b;
b->num_designs = designs;
k = 0;
for (i = 0; i < axes; i++) {
if (b->internal_points[i] <= 0) {
b->internal_break[i] = NULL;
b->internal_value[i] = NULL;
b->internal_points[i] = 0;
} else {
b->internal_break[i] = (int *)
XtMalloc(b->internal_points[i] * sizeof(int));
b->internal_value[i] = (float *)
XtMalloc(b->internal_points[i] * sizeof(float));
}
n = 0;
for (j = 0; j < breakCount[i]; j++) {
else {
b->internal_break[i][n] = blendBreak[k];
b->internal_value[i][n++] = blendBreakValue[k];
}
k++;
}
}
b->design_positions =
b->design_positions[i] = blendPos[i];
}
} else f->blend_data = NULL;
ff->font_count++;
}
{
highest = f;
highestPrev = prev;
}
}
}
}
{
highestPrev = prev;
}
}
}
}
static void AddFamily(
{
int j;
char *ch;
while (*ch != '\0') {
j = 0;
while (1) {
ch++;
weight[j] = '\0';
break;
}
if (*ch == ',') {
j = 0;
ch++;
while (1) {
ch++;
name[j] = '\0';
break;
}
}
}
}
{
int i;
for (i = 0; i < fontCount; i++) {
}
for (i = 0; i < fontCount; i++) {
*ch = '\0';
}
}
}
{
}
{
}
{
}
{
}
{
NULL);
}
{
}
{
}
{
}
{
}
{
}
/* Callbacks for subwidgets */
{
int count;
FILE *f;
stop\n\
Magic end of data line )))))))))) 99#2 2#99 <xyz> // 7gsad,32h4ghNmndFgj2\n";
/* Assume context is correct */
/* A bug in 1006.9 and earlier servers prevents the more robust
downloading method from working reliably. */
}
} else {
}
/* This marks the end of the data stream */
/* Check the results of the download by getting the error status */
}
fclose (f);
return ok;
}
static void UndefSomeUnusedFonts(
{
int i;
if (!all
return;
}
else {
/* Skip to the end of the ones we're keeping */
f = f->pending_delete_next;
}
if (f == NULL) return;
start = &f->pending_delete_next;
}
nextf = f->pending_delete_next;
start = &f->pending_delete_next;
continue;
}
if (!f->resident && !f->in_font_creator) {
}
f->temp_resident = False;
f->pending_delete_next = NULL;
}
}
{
}
FontRec *f,
{
if (!f->resident && !f->temp_resident) {
int resident;
/* This font might already be there, so check before downloading */
if (resident) {
return True;
}
}
_FSBFlushFont(fsb, f);
return False;
}
else f->temp_resident = True;
}
}
return True;
}
static void DoPreview(
{
int i, n;
float size;
FontRec *f;
BlendRec *b;
int bogusFont;
if (!XtIsRealized(fsb)) return;
(XDPSStandardColormap *) NULL,
(XDPSStandardColormap *) NULL,
if (override) {
}
&selectList, &selectCount)) return;
if (selectCount == 0 ||
&selectList, &selectCount)) return;
if (selectCount == 0 ||
*selectList < 1 ||
n = 0;
while (1) {
n += f->blend_count + 1;
if (n >= *selectList) {
n -= f->blend_count;
if (n == *selectList) b = NULL;
else for (b = f->blend_data->blends;
break;
}
f = f->next;
}
}
if (size <= 0.0) return;
if (!_FSBDownloadFontIfNecessary(f, fsb)) return;
if (bogusFont) {
_FSBBogusFont(fsb, f);
}
}
{
}
}
{
}
/* ARGSUSED */
static void PreviewText(
{
CWBitGravity, &att);
}
}
/* ARGSUSED */
static void PreviewCallback(
{
}
/* ARGSUSED */
static void DismissSamplerCallback(
{
}
{
int i;
Widget s;
XtCreatePopupShell("samplerShell",
i = 0;
} else {
}
}
}
{
int i;
XtCreatePopupShell("creatorShell",
i = 0;
}
}
}
/* ARGSUSED */
static void ShowCreatorCallback(
{
}
/* ARGSUSED */
static void ShowSamplerCallback(
{
}
/* ARGSUSED */
static void PreviewDoubleClick(
{
}
/* ARGSUSED */
static void ResizePreview(
{
(XDPSStandardColormap *) NULL,
(XDPSStandardColormap *) NULL,
}
Widget w,
{
int count;
name,
*ch = '\0';
*ch = '_';
return ret;
}
return ret;
}
{
}
Widget w,
{
int count;
name,
*ch = '\0';
*ch = '_';
return ret;
}
return ret;
}
{
}
{
char *chSize;
int i;
} else {
}
} else {
}
} else {
}
} else {
} else {
}
}
} else {
for (i = 0; i < MAX_AXES; i++) {
}
}
}
{
}
}
}
/* If making it shared, be sure to synchronize with
the caller who might be using a different context */
}
}
}
return True;
}
/* ARGSUSED */
static void OKCallback(
{
}
/* ARGSUSED */
static void ApplyCallback(
{
}
static void ResetFSB(
{
int i;
} else {
}
} else {
}
} else {
}
} else {
}
} else {
for (i = 0; i < MAX_AXES; i++) {
}
}
}
/* ARGSUSED */
static void ResetCallback(
{
}
/* ARGSUSED */
static void CancelCallback(
{
}
/* There's a problem; sometimes the change has already been made in the field,
and sometimes it hasn't. The times when it has seem to correspond to
making changes with the size option menu, so we use this disgusting
global flag to notice when this happens. We also use this to tell whether
or not the change is coming from internal to the widget or as a result
of user interaction. */
/* ARGSUSED */
static void SizeSelect(
{
char *ch;
else {
}
}
}
/* ARGSUSED */
static void TextVerify(
{
int i;
int decimalPoints = 0;
if (changingSize) return; /* We know what we're doing; allow it */
/* Should probably look at format field, but seems to contain garbage */
return;
}
}
return;
}
}
if (decimalPoints > 1) {
return;
}
}
}
/* ARGSUSED */
static void SetSize(
{
char *ch;
}
changingSize = True;
}
/* This makes sure the selected item is visible */
static void ListSelectPos(
Widget w,
int pos,
{
}
/* The following function Copyright 1987, 1988 by Digital Equipment
Corporation, Maynard, Massachusetts, and the Massachusetts Institute of
Technology, Cambridge, Massachusetts. */
{
#ifndef X_NOT_POSIX
#else
int uid;
extern int getuid();
#ifndef SYSV386
#endif
#endif
else {
}
else {
*buf = '\0';
}
}
}
if (ptr)
*buf = '/';
buf++;
*buf = '\0';
return buf;
}
static void WriteBlendLine(
FILE *f,
int axes,
float *p)
{
register char *ch;
int i;
while (*ch != '\0') {
}
putc(',', f);
while (*ch != '\0') {
}
putc(',', f);
while (*ch != '\0') {
}
(void) putc(',', f);
while (*ch != '\0') {
}
(void) putc('\n', f);
}
{
FontRec *f;
BlendRec *b;
(void) GetRootDirName(homeDir);
}
if (f->blend_data != NULL) {
b->blend_name, b->font_name,
}
}
}
}
}
float *p)
{
int i;
float f;
}
*dst = '\0';
src++;
}
*dst = '\0';
src++;
}
*dst = '\0';
src++;
}
*dst = '\0';
for (i = 0; i < MAX_AXES; i++) {
src++;
for (/**/; i < MAX_AXES; i++) p[i] = 0;
return True;;
}
else p[i] = f;
}
return True;
}
{
float p[MAX_AXES];
FontRec *f;
char *spaceBlend;
int cmp, i;
(void) GetRootDirName(homeDir);
}
while (1) {
return;
}
if (cfamily != lastFamily) {
}
f = f->next) {}
/* If the blend data is NULL, we have a blend line for a font
that we don't believe is a MM font. Ignore it */
cmp = -1;
if (cmp < 0) break;
}
if (cmp != 0) {
f->blend_count++;
ff->blend_count++;
}
}
}
}
}
static void SetUpFaceList(
{
FontRec *f;
BlendRec *b;
int i;
if (f->blend_data != NULL) {
break;
}
}
else UnmanageMultipleMaster(fsb);
sizeof(XmString));
i = 0;
CSfaces[i++] = f->CS_face_name;
if (f->blend_data != NULL) {
CSfaces[i++] = b->CS_space_blend_name;
}
}
}
}
/* ARGSUSED */
static void DeleteMessage(
{
}
static void FlushFont(
{
if (f == font) goto FOUND_BOGUS;
}
}
if (f != NULL) {
break;
}
}
} else {
}
ff->font_count--;
}
}
/* We do not free the FontRec or FontFamilyRec. In the long
run we don't expect to leak much storage this way, since we
shouldn't have many bogus fonts, and invalidating every
reference here, in the sampler, and in the creator isn't
worth the small storage waste. */
} else {
}
}
}
}
}
void _FSBFlushFont(
{
}
void _FSBBogusFont(
{
XtUnmanageChild(w);
XtUnmanageChild(w);
/* Now get this blasted thing out of here */
}
void _FSBSetUpFaceList(
{
FontRec *f;
BlendRec *b;
int i;
i = 1;
while (f != NULL) {
if (f->blend_data != NULL) {
b = f->blend_data->blends;
i++;
while (b != NULL &&
i++;
b = b->next;
}
}
}
break;
} else {
i += f->blend_count+1;
f = f->next;
}
}
}
{NULL},
};
#define NORMALINDEX 0][0
static int MatchFaceName(
{
int i, j, k, face;
int numPieces;
int pass;
char save;
if (!categoriesInited) {
for (i = 0; categories[i][0] != NULL; i++) {
for (j = 0; categories[i][j] != NULL; j++) {
}
}
for (i = 0; extraNormalFaces[i] != NULL; i++) {
}
}
goto GIVE_UP;
}
/* First check for an exact match */
for (i = 0; i < rec->num_available_faces; i++) {
}
/* Try some category matching. We make two passes; in the first pass
we remove "Bold" from the "Demi" family and "Light" and "Book" from
the "Regular" family; in the second pass we include them. We ignore
leading digits in the face name. */
i = 0;
while (1) {
*ch = '\0';
for (j = 0; categories[j][0] != NULL; j++) {
for (k = 0; categories[j][k] != NULL; k++) {
if (compare == categories[j][k]) {
pieces[i++] = categories[j][0];
goto FOUND_PIECE;
}
}
}
if (*ch == '\0') break;
}
numPieces = i;
/* Special case starting with the italic category */
numPieces++;
}
if (pass == 1) {
for (i = 0; i < numPieces; i++) {
if (pieces[i] == canonicalBold) {
} else if (pieces[i] == canonicalLight) {
} else if (pieces[i] == canonicalBook) {
}
}
}
/* Now match against each face */
i = 0;
while (1) {
*ch = '\0';
for (j = 0; categories[j][0] != NULL; j++) {
for (k = 0; categories[j][k] != NULL; k++) {
if (compare == categories[j][k]) {
compare = categories[j][0];
goto MATCH;
}
}
}
/* Special case matching the italic category again */
numPieces > 1 &&
goto NEXT_FACE;
} else i++;
if (*ch == '\0') break;
}
;
}
}
/* Couldn't find a match. Look for a "normal face". Make sure "Light"
and "Book" are installed. Again, ignore leading spaces. */
for (i = 0; categories[0][i] != NULL; i++) {
}
}
}
for (i = 0; extraNormalFaces[i] != NULL; i++) {
}
}
}
/* Oh, well. Use the first one */
return 0;
}
static void GetInitialFace(
{
int i, j;
FontRec *f;
i = 0;
for (i = 0; i < ff->font_count; i++) {
}
}
}
j = 0;
j += f->blend_count + 1;
i--;
}
}
/* ARGSUSED */
static void FamilySelect(
{
int i;
}
/* List uses 1-based addressing!! */
}
/* ARGSUSED */
static void FaceSelect(
{
FontRec *f;
BlendRec *b;
int n;
}
/* List uses 1-based addressing!! */
n = 0;
while (1) {
n += f->blend_count + 1;
if (n >= listCB->item_position) {
n -= f->blend_count;
b = b->next) n++;
break;
}
f = f->next;
}
}
static void CreateSizeMenu(
{
int i, j;
char *ch;
if (destroyOldChildren) {
/* Don't destroy first child ("other") */
} else {
i = 0;
}
i = 0;
sizes[j+1] =
}
}
{
int i;
i = 0;
i = 0;
i = 0;
i = 0;
i = 0;
i = 0;
i = 0;
i = 0;
i = 0;
i = 0;
i = 0;
i = 0;
i = 0;
i = 0;
i = 0;
}
i = 0;
i = 0;
/* The next two must be widgets in order to be reversed in color */
i = 0;
i = 0;
i = 0;
i = 0;
i = 0;
i = 0;
i = 0;
i = 0;
}
{
}
/* The list makes a copy, so we can delete the list */
}
{
FontRec *f;
BlendRec *b;
int i, j;
}
return;
}
}
i = 1;
j = 1;
return;
}
j++;
False);
False);
return;
}
j++;
}
}
}
i++;
}
/* Didn't find it! */
}
{
FontRec *f;
BlendRec *b;
int i;
} else {
}
} else {
}
i = 1;
break;
}
i++;
}
}
return;
}
i = 1;
i++;
break;
}
}
if (b == NULL) {
i -= f->blend_count;
}
}
break;
}
i += f->blend_count + 1;
}
} else {
f = NULL;
}
}
{
}
{
changingSize = True;
return;
} else UnmanageSizeMultiple(fsb);
changingSize = True;
}
{
}
/* ARGSUSED */
static void Initialize(
{
/* Verify size list */
"initializeFontBox", "sizeMismatch",
"FontSelectionBoxError",
"Size count specified but no sizes present",
}
"initializeFontBox", "negativeSize",
"FontSelectionBoxError",
"Size count should not be negative",
}
"initializeFontBox", "nonPositivePendingDelete",
"FontSelectionBoxError",
"Pending delete max must be positive",
}
/* Copy strings. SetUpCurrentSelection will copy the font strings */
}
}
}
/* Get the context */
}
dps_init_bit_fsb, &inited) ==
}
if (!inited) {
}
/* Initialize non-resource fields */
}
{
if (f->blend_data != NULL) {
bd = f->blend_data;
XtFree((char *) b);
}
}
}
static void FreeFontLists(
{
/* font_name, face_name, family_name, and blend_name are canonical
strings and so should not be freed. The face and blend compound
strings were gotten from converters and so should likewise remain. */
FreeFontRec(f);
XtFree((char *) f);
}
}
}
{
/* Lots of stuff to destroy! */
}
}
}
{
}
/* ARGSUSED */
{
"setValuesFontBox", "sizeMismatch",
"FontSelectionBoxError",
"Size count specified but no sizes present",
}
"setValuesFontBox", "negativeSize",
"FontSelectionBoxError",
"Size count should not be negative",
}
"setValuesFontBox", "nonPositivePendingDelete",
"FontSelectionBoxError",
"Pending delete max must be positive",
}
if (NE(preview_string)) {
do_preview = True;
}
if (NE(default_resource_path)) {
refreshLists = True;
}
if (NE(resource_path_override)) {
refreshLists = True;
}
}
dps_init_bit_fsb, &inited) ==
}
if (!inited) {
}
}
if (refreshLists) {
setSelection = True;
}
setSelection = True;
}
if (NE(show_sampler)) {
}
if (NE(show_sampler_button)) {
}
}
}
}
return False;
}
/* ARGSUSED */
Widget w,
{
if (WANTS(CWBorderWidth)) {
}
return XtGeometryYes;
}
{
}
static void SetFontName(
Widget w,
{
}
void FSBSetFontName(
Widget w,
{
(w, name, name_multiple);
}
static void SetFontFamilyFace(
Widget w,
{
}
void FSBSetFontFamilyFace(
Widget w,
{
}
static void SetFontSize(
Widget w,
double size,
{
int i;
union {
int i;
float f;
} kludge;
i = 0;
if (sizeof(float) > sizeof(XtArgVal)) {
XtSetValues(w, args, i);
}
void FSBSetFontSize(
Widget w,
double size,
{
(w, size, size_multiple);
}
{
}
void FSBRefreshFontList(
Widget w)
{
}
static void GetFamilyList(
Widget w,
int *count,
{
}
}
void FSBGetFamilyList(
Widget w,
int *count,
{
}
static void GetFaceList(
Widget w,
int *count,
{
FontRec *f;
}
*count = 0;
return;
}
}
}
void FSBGetFaceList(
Widget w,
int *count_return,
{
}
void FSBUndefineUnusedFonts(
Widget w)
{
}
{
FontRec *f;
int resident;
&resident);
}
else {
return ret;
}
}
}
}
}
Widget w,
{
return (*((FontSelectionBoxWidgetClass)
}
Widget w,
{
int i;
FontRec *f;
}
return False;
}
i = 0;
return !retVal;
}
Widget w,
{
return (*((FontSelectionBoxWidgetClass)
}
static void FontNameToFamilyFaceBlend(
Widget w,
{
FontRec *f;
BlendRec *b;
return;
}
if (f->blend_data != NULL) {
*blend = b->blend_name;
return;
}
}
}
}
}
}
static void FontNameToFamilyFace(
Widget w,
{
}
void FSBFontNameToFamilyFace(
Widget w,
{
}
static void FontFamilyFaceBlendToName(
Widget w,
{
FontRec *f;
BlendRec *b;
}
return;
}
}
if (f == NULL) {
return;
}
return;
}
if (f->blend_data == NULL) {
return;
}
if (b->blend_name == blend) {
return;
}
}
}
static void FontFamilyFaceToName(
Widget w,
{
}
void FSBFontFamilyFaceToName(
Widget w,
{
}
Widget w,
{
return (*((FontSelectionBoxWidgetClass) XtClass(w))->
}
Widget w,
{
return (*((FontSelectionBoxWidgetClass) XtClass(w))->
}
static void GetTextDimensions(
Widget w,
double size, double x, double y,
{
int bogusFont;
}
void FSBGetTextDimensions(
Widget w,
double size, double x, double y,
{
(*((FontSelectionBoxWidgetClass) XtClass(w))->
}
static void SetFontFamilyFaceBlend(
Widget w,
{
}
Widget w,
{
(*((FontSelectionBoxWidgetClass) XtClass(w))->
}
Widget w,
{
(*((FontSelectionBoxWidgetClass) XtClass(w))->
}
Widget w,
{
(*((FontSelectionBoxWidgetClass) XtClass(w))->
}
static void GetBlendList(
Widget w,
int *count_return,
float **axis_values_return)
{
float *buf3;
FontRec *f;
BlendRec *b;
int i;
}
}
*count_return = 0;
return;
}
*count_return = f->blend_count;
*font_name_return = buf2 =
*axis_values_return = buf3 =
*buf1++ = b->blend_name;
}
}
void FSBGetBlendList(
Widget w,
int *count_return,
float **axis_values_return)
{
(*((FontSelectionBoxWidgetClass) XtClass(w))->
}
static void GetBlendInfo(
Widget w,
int *num_axes_return,
int *num_designs_return,
float **blend_positions_return,
int **blend_map_count_return,
int **blend_design_coords_return,
float **blend_normalized_coords_return)
{
FontRec *f;
int i, j;
float *fbuf;
int *ibuf;
int coords;
} else {
}
}
*num_axes_return = *num_designs_return = 0;
return;
bd = f->blend_data;
}
*axis_names_return = sbuf =
coords = 0;
}
}
*fbuf++ = 0.0;
for (j = 0; j < bd->internal_points[i]; j++) {
}
*fbuf++ = 1.0;
}
}
void FSBGetBlendInfo(
Widget w,
int *num_axes_return,
int *num_designs_return,
float **blend_positions_return,
int **blend_map_count_return,
int **blend_design_coords_return,
float **blend_normalized_coords_return)
{
(*((FontSelectionBoxWidgetClass) XtClass(w))->
}
Widget w,
int *axis_values,
float *axis_percents)
{
FontRec *f;
int i;
if (b->blend_name == blend_name) break;
}
goto FOUND_BASE;
}
}
}
return False;
if (action != FSBDeleteBlend) {
if (axis_values != NULL) {
val[i] = axis_values[i];
}
} else {
pct[i] = axis_percents[i];
}
}
}
switch (action) {
case FSBAddBlend:
f->blend_count++;
ff->blend_count++;
}
break;
case FSBReplaceBlend:
break;
case FSBDeleteBlend:
} else {
}
f->blend_count--;
ff->blend_count--;
/* Don't actually delete the blend record, in case it's displayed
in the sampler. */
break;
}
return True;
}
Widget w,
int *axis_values,
float *axis_percents)
{
return (*((FontSelectionBoxWidgetClass) XtClass(w))->
}
void _FSBSetCurrentFont(
{
FontRec *f;
BlendRec *b;
int i, j;
i = 1;
j = 1;
b = NULL;
goto FOUND_NAME;
}
j++;
goto FOUND_NAME;
}
j++;
}
}
}
i++;
}
return;
}
float _FSBNormalize(
int val,
int i)
{
int j;
if (bd->internal_points[i] == 0) {
}
/* Find the largest breakpoint less than val and the smallest one greater
than it */
lessValue = 0.0;
moreValue = 1.0;
for (j = 0; j < bd->internal_points[i]; j++) {
}
}
}
}
float val;
int i;
{
int j;
if (bd->internal_points[i] == 0) {
}
/* Find the largest breakpoint less than val and the smallest one greater
than it */
lessValue = 0.0;
moreValue = 1.0;
for (j = 0; j < bd->internal_points[i]; j++) {
}
}
}
}
int *val,
{
int i;
char *ch;
}
}