InomHitta mer dokumentationSupportresurser som ingår | Ladda ner denna bok i PDF (1326 KB)
Chapter 17 Administering Application Resources, Fonts, and ColorsYou can choose a wide range of colors and fonts for your display either by using Style Manager or by customizing additional font and color resources. This chapter discusses how to customize fonts and color resources. This chapter also describes how to specify style translations for DtEditor widget applications such as the desktop text editor (dtpad) and Mailer (dtmail), and alternates for DtEditor widget application menu accelerators that conflict with these translations. Setting Application ResourcesResources are used by applications to set certain aspects of appearance and behavior. For example, Style Manager (dtstyle) provides resources that enable you to specify where the system looks for files containing information about color palettes: dtstyle*paletteDirectories: /usr/dt/palettes/C HomeDirectory/.dt/palettes App-default files for the desktop applications are located in the /usr/dt/app-defaults/language directory. To Set System-Wide ResourcesAdd the resources to the file /etc/dt/config/language/sys.resources. (You may have to create the file.) For example, if in /etc/dt/config/C/sys.resources you specify: AnApplication*resource: value then the resource AnApplication*resource will be set in each user's RESOURCE_MANAGER property at the next login. Note – For more information about Style Manager resources, see the dtstyle man page. For more information about Mailer resources, see the dtmail man page. To Set Personal ResourcesHow the Desktop Loads ResourcesResources are loaded at session startup by Session Manager. For information on how Session Manager loads the resources into the RESOURCE_MANAGER, see Loading the Session Resources. Process Manager ResourcesThe following Process Manager Resources are available:
Defining UNIX BindingsBy default UNIX bindings are not enabled. To Specify-EMACS Style TranslationsThe following procedure specifies:
To Modify the EMACS-Style Translations
UNIX Bindings Provided by the UNIXbindings FileThe /usr/dt/app-defaults/language/UNIXbindings file provides the bindings described in the tables below. Note – The Delete key deletes the previous character when the UNIX bindings are enabled, and Shift-Delete deletes the next character. Table 17–1 lists the dtpad overrides for menu accelerators and accelerator text that conflict with the UNIX bindings. Table 17–1 dtpad Overrides
Table 17–2 lists the dtmail Compose window overrides for menu accelerators and accelerator text that conflict with the UNIX bindings. Table 17–2 dtmail Compose Window Overrides
The following translations provide (GNU style) EMACS control and Meta key bindings plus some additional bindings. When appropriate, they also allow the Shift key to be used in combination with the normal binding to reverse the direction of the operation. For example, Ctrl+Shift+F will move the cursor backward a character since Ctrl+F normally moves it forward a character. The additional bindings are: Ctrl+comma—backward-word Ctrl+Shift+comma—forward-word Ctrl+period—forward-word Ctrl+Shift+period—backward-word Ctrl+Return—end-of-file Ctrl+Shift+Return—beginning-of-file GNU EMACS binds delete-previous-character() rather than delete-next-character() to the Delete key. Meta+F is normally the mnemonic for the File menu, so the binding to forward-word() will be ignored. Use one of the other bindings for forward-word (for example, Ctrl+period). Table 17–3 lists the DtEditor.text Translations Table 17–3 DtEditor.text Translations
Administering FontsUsing the Style Manager Font dialog box, you can select the font group and size you want for all applications. You can also specify fonts on the command line or use resources to:
A font is a type style in which text characters are printed or displayed. The desktop includes a variety of fonts in different styles and sizes. A bitmap font is made from a matrix of dots. (By default, Style Manager configures bitmap fonts only.) The font is completely contained in one file. Many files are needed to have a complete range of sizes, slants, and weights. Fonts are specified as values of resources and as parameters to commands. The X Logical Font Description (XLFD) name is the method by which a desired font is requested. The system finds the font that best matches the description it was given. Setting Desktop Font ResourcesThe Style Manager Font dialog box enables you to select fonts (up to seven sizes) for things such as text entry and labels. It also enables you to add or delete font groups. Resources Set by the Font Dialog BoxWhen a font is selected, the following resources are written to the RESOURCE_MANAGER property:
Resources Used by the Font Dialog BoxThe fonts used for each selection in the Font dialog box are specified in the /usr/dt/app-defaults/Dtstyle resource file. Up to seven sizes can be specified.
Note – The default fonts for these resources have been chosen for readability on various displays. If you want a specific font for an application, set the font with an application font resource rather than changing these desktop fonts. For more information about application fonts, see the DtStdAppFontNames(5) and DtStdInterfaceFontNames(5) man pages. To List Available Fonts
To Specify Fonts on the Command LineUse the -xrm command-line option to specify a font resource for a specific client. For example: application name -xrm \ "*bitstream-charter-medium-r-normal-8-88-75-75-p-45-iso8859-1" X Logical Font Description (XLFD)A font is specified by listing fourteen different characteristics, separated by dashes (-). This is called the X Logical Font Description (XLFD). In some cases, a property in the list can be replaced by a * wildcard, and a character within a property can be replaced by a ? wildcard. Table 17–4 lists font property string specifications. The form of the property string specification is: "-Foundry-FamilyName-WeightName- Slant-SetwidthName-AddStyleName-PixelSize- PointSize-ResolutionX-ResolutionY-Spacing- AverageWidth-CharSetRegistry-CharSetCoding" Table 17–4 Font Property String Specification
ExampleThe following XLFD name describes a font named charter made by Bitstream that supports the ISO8859-1 standard encoding: -bitstream-charter-medium-r-normal--8-80-75-75-p-45-iso8859-1 It is medium weight, with no special slanting, and normal width. The font is proportional, with an em-square box of 8 pixels or 8.0 points. The horizontal and vertical resolution are both 75 pixels. The average width of a character is 45 1/10ths pixels or 4.5 pixels. Parts of this string can be replaced by wildcards. The system uses the first font it finds that matches the parts you have specified. If all you want is an eight-pixel charter font, you could use: *-charter-*-*-*-*-8-* Viewing Selected Font Group AttributesBy selecting the Attributes button from the Style Manager Font dialog box, you can view the following font group attributes:
User's Font Group Filesystem StorageWhen a user adds a font group, it is stored in the following location: HomeDirectory/.dt/sdtfonts/host/locale/typeface-nnnnnn host is the local workstation's host name. locale is the user's current locale such as “C” or “ja.” typeface-nnnnnn is a name derived from the selected font and a unique generated number. This font group directory contains the following three files
The fonts.alias and fonts.dir files are the normal X11 font files suitable for adding to the Xserver's font path. The sdtfonts.group file contains the user specified font group name. System Administrator Font Group CreationSo that other users can access the font groups on a workstation, the system administrator can copy font groups to the /etc/dt/sdtfonts/locale directory or to the /usr/openwin/lib/X11/stdfonts/locale directory. Session Manager first looks in HomeDirectory/.dt/stdfonts/host/locale, next in /etc/dt/sdtfonts/locale, and last in /usr/openwin/lib/X11/stdfonts/locale. Administering ColorsThis section describes:
Color PalettesA palette consists a group of color sets. The color sets for the current palette are shown in the Style Manager Color dialog box A file exists for each palette. The paletteDirectories resource specifies the directories containing palette files. By default, this resource contains:
Color SetsEach color set in the current palette is represented by a color button in the Style Manager Color dialog box. Each color is identified by a color set ID—a number from 1 to 8. Figure 17–1 Color set ID values for HIGH_COLOR
Each color set is composed of up to five colors. Each color button displays the background color of the color set. The five colors in each color set represent the following display component resources: foreground—the foreground of an application window or window frame. It is always black or white. This is generally used for text within windows and titles. background—the background of the application or the window frame. topShadowColor—the color of the top and left bevels of application controls (such as push buttons) and window frames. bottomShadowColor—the color of the bottom and right bevels of application controls and window frames. selectColor—the color that indicates the active state of certain controls, such as active toggles and buttons. The number of color sets used by each palette is determined by the colorUse resource, which the user can set using the Style Manager Number of Colors To Use dialog box. Specifying Color ValuesStyle Manager uses RGB values when writing color information to its palette files. The syntax for RGB numbers is: #RedGreenBlue Red, Green, and Blue are hexadecimal numbers, each 1 to 4 digits long, that indicate the amount of that color used. There must be the same number of digits for each of the colors. Thus, valid color values consist of 3, 6, 9, or 12 hexadecimal digits. For example, white can be specified in any of the following ways: #fff #ffffff #fffffffff #fffffffffffff If you set a color resource directly, you can use either the color name or RGB value. The file /usr/lib/X11/rgb.txt lists all the named colors. How Color Sets are Mapped to ResourcesThe desktop maps color sets to various display elements through resources and makes the assignments shown in Table 17–5. Table 17–5 Mapped Color Sets to Resources
These resources take a color set ID as their value. Coloring display elements with color set IDs allows the element to dynamically change to the new color scheme when a new palette is selected with Style Manager. You can use these resources for individual applications. For example, the following line shows how you would visually group all dtterm windows by using color set 8 for their primary color. dtterm*primaryColorSetId: 8 Default Color Set AssignmentsThe color set IDs used for display elements depend on the Number of Colors setting in Style Manager: Table 17–6 shows the color set IDs for high color (8 color sets)—Style Manager setting More Colors for Desktop. Table 17–6 High color
Table 17–7 shows the color set IDs for medium color (4 color sets)—Style Manager setting More Colors for Applications. Table 17–7 Medium color
Table 17–8 shows the color IDs for low color (2 color sets)—Style Manager setting Most Colors for Applications. Table 17–8 Low color
Controlling Color with Style ManagerYou can dynamically change color for desktop applications and other cooperating applications through Style Manager. The foreground and background colors set by Style Manager are available to non-cooperating applications. For a client to respond to Style Manager color changes, the client must be using the desktop Motif library. Clients written with other toolkits cannot change color dynamically in response to Style Manager changes. Color changes for these clients do not take effect until the client is restarted. There must be no other specific color resources applied for the client. This includes user-specified resources, application defaults, and resources built into the application. Clients can specify primaryColorSetId and secondaryColorSetId resources to use certain colors within a desktop palette. Number of Colors Used by Style ManagerThe number of colors used by Style Manager depends on the values for the following resources: colorUse—configures the number of colors the desktop uses shadowPixmaps—directs the desktop to replace the two shadow colors with pixmaps foregroundColor—specifies if the foreground color changes dynamically dynamicColor—controls whether applications change color when you switch palettes Table 17–9lists the maximum number of colors allocated by the desktop. Table 17–9 Number of Desktop Colors
To determine the maximum number of colors:
colorUse ResourceThe default value of the colorUse resource is MEDIUM_COLOR. The value of this resource affects the number of color sets used in a palette. Other resources affect the number of colors used to make shadows. The value of the colorUse resource also affects the use of multi-color icons.
shadowPixmaps ResourceThe shadowPixmaps resource directs the desktop to replace the two shadow colors with pixmaps. These pixmaps mix the background color with black or white to simulate top or bottom shadow values. This reduces the number of needed colors by two, since color cells do not need to be allocated for the shadow colors.
The default value for shadowPixmaps depends on the colorUse resource you have and the hardware support for the display. foregroundColor ResourceThe foregroundColor resource specifies how the foreground is configured in a palette.
If foregroundColor is set to either Black or White, the number of colors in the color set is reduced by one, and the foreground will not change in response to changes in the background color. The default value for foregroundColor is Dynamic, except where the value of colorUse is B_W. dynamicColor ResourceThe dynamicColor resource controls whether applications change color dynamically; that is, whether the clients change color when you switch palettes.
When the value of the dynamicColor resource is True, clients that cannot change colors dynamically (non-Motif applications) allocate different cells in the color map than clients that can change colors dynamically, even if you see the same color. Note – Since all clients can share the same color cells, setting dynamicColor to False reduces the number of colors your desktop consumes. Setting Shadow Thicknesses for Application WindowsThe desktop defines a default shadow thickness of one pixel for the components in application windows, such as button shadows and focus highlight. Motif 1.2 applications use this resource value; other applications may not obtain this resource value and therefore will appear different on the display. To set the shadow thickness to one pixel for non-Motif 1.2 applications:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||