File: XmFontSelector.3

package info (click to toggle)
motif 2.3.8-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 36,432 kB
  • sloc: ansic: 452,643; sh: 4,613; makefile: 2,030; yacc: 1,604; lex: 352; cpp: 348
file content (385 lines) | stat: -rw-r--r-- 11,483 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
.DT
.TH XmFontSelector 3X ""
.SH NAME
XmFontSelector \- The Font Selector widget
.SH SYNOPSIS
#include <Xm/FontS.h>
.SH DESCRIPTION
.PP
.TS
tab (%);
l l.
.TE
.PP
The Font Selector widget allows users to easily choose a font by selecting the font 
family and size of the font. The bold and italic attributes may also be set for any font 
for which they are available. Any font may be passed to the font selector by the application 
as the initial value shown to the user. Advanced features greatly extend the widget's 
functionality.
.PP
.SH Basic Features
.PP
The font selector widget presents the user with two combination box widgets, one 
with a list of choices for the font family, and the other with the choices for the font 
size. In addition there are two independent toggle buttons that allow the user to make 
the font bold or italic or bold/italic. Below the font choice area is a text widget that 
displays sample text of the chosen font to the user. This text area is editable, allowing 
the user to add or remove text to see how various characters appear in the chosen font. 
For the novice user this set of features allows access to  all standard fonts on the system. 
The font selector dynamically removes choices that are inappropriate so the user 
is free to play around with different combinations and can always be assured that once 
they have selected a font that it will exist on the machine that the font selector is running 
on. For example if there is no Times Roman 14 point font available, and the user 
selects a point size of 14, then Times Roman will not be available in the family combination 
box. Likewise, if the user had chosen Times Roman from the family dialog 
box then a size of 14 would not be shown. To have all choices available simply choose 
a size and family of Any.
.PP
.SH Advanced Features
.PP
For the advanced user the font selector provides tremendous flexibility in font choices. 
By activating the options button an additional panel of controls is presented to the 
user. This allows the user to gain access to non-XLFD fonts, control the resolutions 
of the fonts chosen, choose from fixed or proportional fonts only, remove the use of 
font scaling, allow non iso8859-1 fonts to be viewed, and see the XLFD name the font 
selector is constructing.
.PP
.SH Non XLFD Fonts
.PP
By choosing the "Other Fonts" toggle from the option panel, the family and size lists, 
as well as the bold and italic toggles, are replaced with a combo box containing all non-XLFD 
fonts available on your system. This feature allows users to select non-XLFD 
fonts with the FontSelector. The text field of the combination box may be edited by 
the user and any string entered will be interpreted as a font name. It should be noted 
that XLFD names can be typed in by hand here. This feature allows the font selector 
to be used to get any font on the entire system.
.PP
.SH Resolution Control
.PP
The font selector finds which of the two standard resolutions the current display is 
closest to and uses that as its default. To allow a wider range of choices a user may 
choose to access fonts of a different resolution, or both 75 and 100 dpi resolutions.
.PP
.SH Fixed or Proportional
.PP
In most cases the fact that a font is fixed width or proportional is of no great interest 
to the user. But some applications require a fixed width font, such as terminal emulators, 
and most people find that proportional fonts look better. The Font selector allows users to 
limit the font choices to fixed width or proportional or to allow both.
.PP
.SH Font Scaling
.PP
The font scaling technology that is available in X11R5 uses bitmap scaling which, although 
useful in some cases, generally results in very ugly fonts. We noticed that users 
often wanted to know which fonts are scaled and which ones exist as hand crafted bitmaps. 
To remove the scaled fonts from the list of choices, toggle the "Use Font Scaling" button off. 
This value is resource controllable and defaults to on, which uses font 
scaling.
.PP
.SH Encoding
.PP
The programmer can specify which encidings are valid selections. These encoding choices appear in an option menu. The list of font choices is restricted to those which use the current selected coding. 
.PP
.SH XLFD Name Display
.PP
Clicking the Show toggle displays the current font's XLFD name is shown at the bottom of the font selector.
.PP
.SH Normal Resources
.PP
.TS
tab (%);
l l l l.
Name%Class%Type%InitialValue
100DPIstring%100DPIString%XmString%"100 dpi"
75DPIstring%75DPIString%XmString%"75 dpi"
anyLowerString%AnyLowerString%XmString%"any"
anyString%AnyString%XmString%"Any"
boldString%BoldString%XmString%"Bold"
bothString%BothString%XmString%"Both"
currentFont%String%String%NULL
defaultEncodingString%DefaultEncodingString%String%"iso8859-1"
encodingList%EncodingList%StringTable%"iso8859-1"
encodingString%EncodingString%XmString%"Encoding"
familyString%BothString%XmString%"Family"
italicString%ItalicString%XmString%"Italic"
marginHeight%Margin%Dimension%0
monoSpaceString%MonoSpaceString%XmString%"Fixed Width
%%% Fonts"
optionString%OptionString%XmString%"Options ..."
otherString%OtherString%XmString%"Other Fonts"
propSpaceString%PropSpaceString%XmString%"Proportional
%%% Fonts"
sampleText%SampleText%XmString%"abcdef..."
scalingString%ScalingString%XmString%"Use Font
%%% Scaling"
showFontName%ShowFontName%Boolean%False
showNameString%ShowNameString%XmString%"Show Font
%%% Name"
sizeString%SizeString%XmSring%"Size"
spacing%Spacing%Dimension%2
textRows%TextRows%Dimension%8
useScaling%Boolean%Boolean%True
valueChangedCallback%Callback%XtCallbackList%NULL
xlfdString%XlfdString%XmString%"Xlfd Fonts"
.TE
.PP
All resource names begin with XmN and all resource class names begin with XmC.
.PP
.SH 100DPSString
.PP
The label for the 100 DPI radio button.
.PP
.SH 75DPSString
.PP
The label for the 75 DPI radio button.
.PP
.SH anyLowerString
.PP
The label for the any button.
.PP
.SH anyString
.PP
The label for the Any button.
.PP
.SH boldString
.PP
The label for the Bold toggle button.
.PP
.SH bothString
.PP
The labels for the Both radio buttons controlling both the dpi and width of the fonts displayed. The same resource is used to ensure consistent labels.
.PP
.SH currentFont
.PP
This resource provides the main application input and output to the font selector. 
If the programmer sets the value at creation time or with XtSetValues then the 
currently displayed family, size, bold and italic will be changed to correspond to 
the values shown in the current font. Otherwise, the name of the font will be 
shown. The Font Selector's mode will be set to correspond to the type of font 
passed.
.PP
Note: currentFont must contain 14 hyphens (-) to be considered an XLFD 
font. This resource is also used to retrieve the font the user has selected from the 
font selector. The value returned is only valid until the next time XtGetValues is 
called on this instance of the font selector widget.
.PP
.SH defaultEncodingString
.PP
This resource is the default selection from the Encoding options menu.
.PP
.SH encodingList
.PP
This resource is the list of encodings available from the FontSelector Encoding options menu.
.PP
.SH encodingString
.PP
This resource is the default selection from the Encoding options menu.
.PP
.SH familyString
.PP
This resource is the default selection from the Family options menu.
.PP
.SH isoFontsOnly
.PP
This resource controls and maintains the state of the iso8859-1 fonts only toggle 
button.
.PP
.SH italicString
.PP
This resource is the default selection from the Italic toggle button.
.PP
.SH marginHeight
.PP
The margin height for all subwidgets of the Font Selector. 
.PP
.SH monoSpaceString
.PP 
The label of the Fixed Width Fonts radio button.
.PP 
.SH optionString
.PP 
The label for the Options... push button.
.PP 
.SH otherString
.PP 
The label for the Other Fonts radio button.
.PP 
.SH propSpaceString
.PP 
The label for the Proportional Fonts radio button.
.PP 
.SH sampleText
.PP
The string which appears in the sample text area.
.PP
.SH scalingString
.PP
The label for the Use Font Scaling toggle button.
.PP
.SH showFontName
.PP
This boolean resource controls and maintains the state of Show Font Name toggle button.
.PP
.SH showNameString
.PP
The label of the Show Font Name toggle button.
.PP
.SH sizeString
.PP
The label for the Size option menu.
.PP
.SH spacing
.PP
The space between the toggle indicator and the toggle label.
.PP
.SH textRows
.PP
This resource controls the number of rows that are shown in the text widget that 
displays sample text in the currently selected font. Since this is a scrolled text 
widget it will never dynamically change size, regardless of the font displayed. 
Unless the initial font is large this value should be at least 4 or the user interaction 
may be poor.
.PP
.SH useScaling
.PP
This resource controls and maintains the state of the Use Font Scaling toggle 
button.
.PP
.SH valueChangedCallback
.PP
The list of callbacks called when the XmNcurrentFont value is changed.
.PP
.SH xlfdString
.PP
The label for the Xlfd Fonts radio button.
.PP
.SH Convenience Routine
.PP
.SH 
.HP 5
.SH XmCreateFontSelector  - Widget creation convenience routine 
.nf

Widget XmCreateFontSelector( 
	Widget parent,      /* Widget id of parent for FontSelector */
	String name,        /* Name of the created widget */
	ArgList args,       /* argument list */
	Cardinal num_args   /* number of items in argument list */
	)				 

.nf
.PP
.SH Children
.PP
The font selector is composed of many sub-widgets. As with all widgets, most values 
passed to this widget through the argument list  at creation time or via set values 
are passed to each of this widget's children. Get values requests must be made on a 
child by child basis. The children of the font selector 
are listed below. The documentation for each of the children should be consulted for 
a list of resources for each child.

.ta 5,10,15,20,25,30,35
.df
XiFontSelector	<named by application>

	XiPaned	topPane

		XmComboBox	families

			< See XmComboBox for list of children >

		XmSeparator	separator

		XiComboBox	sizes

			< See XmComboBox for list of children >

		XmSeparator	separator

		XmButtonBox	boldItalicBox

			XmToggleButton	boldButton

			XmToggleButton	italicButton

		XmSeparator	separator

		XmToggleButton	optionButton

	XmSeparator	separator

	XmPaned	middlePane

		XmPaned	leftPane

			XmButtonBox	choiceBox

				XmToggleButton	xlfdButton

				XmToggleButton	otherButton

			XmSeparator	separator

			XmButtonBox	resolutionBox

				XmToggleButton	dpi75Button

				XmToggleButton	dpi100Button

				XmToggleButton	anyButton

			XmSeparator	separator

		XmSeparator	separator

		XmButtonBox	spacingBox

			XmToggleButton	proportionalButton

			XmToggleButton	monoButton

			XmToggleButton	bothButton

		XmSeparator	separator

		XmButtonBox	otherChoiceBox

			XmToggleButton	scalingButton

			XmToggleButton	isoButton

			XmToggleButton	showNameButton

			XmRowColum      encodingOptionMenu

				XmLabelGadget OptionLabel 

				XmCascadeButtonGadget OptionButton

			XmMenuShell    	menuShell

				XmRowColum      pulldownMenu

					<dependent on XmNencoding>

		XmSeparator	separator

	XmSeparator	separator

	XmButtonBox	box

		XmScrolledWindow	textSW

			XmScrollBar	vbar

			XmText	text

		XmSeparator	separator

		XmLabel	nameLabel

		XmSeparator	separator
.PP
.SH COPYRIGHT
.PP
Copyright (c) 1992 by Integrated Computer Solutions, Inc.