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.UNIX key bindings.Setting Application Resourcesapplication resources, See resources<$nopage>resourcessettingResources 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/palettesApp-default files for the desktop applications are located in the
/usr/dt/app-defaults/language directory.resourcesapp-defaultsapp-defaultsdesktop applicationsTo Set System-Wide Resourcesresourcessystem-wideAdd the resources to the file /etc/dt/config/language/sys.resources fileX resources, See resources<$nopage>
sys.resources.
(You may have to create the file.)For example, if in /etc/dt/config/C/sys.resources you specify:AnApplication*resource: valuethen the resource AnApplication*resource will be set in each user's
RESOURCE_MANAGER property at the next login.To Set Personal ResourcesresourcespersonalAdd the resources to the file HomeDirectory/.Xdefaults..Xdefaults file[Xdefaults file]Double-click Reload Resources in the Desktop_Tools application group.How the Desktop Loads ResourcesResources are loaded at session start-up by Session Manager. For information
on how Session Manager loads the resources into the RESOURCE_MANAGER,
see
.Defining UNIX BindingsUNIX key bindingsEMACS style translationsDtEditor, style translations forBy default UNIX bindings are not enabled.To Specify EMACS-Style TranslationsEMACS translationsThe following procedure specifies:EMACS-style translations for DtEditor widget applications such as the
desktop Text Editor (dtpad) and Mailer (dtmail)Alternates for DtEditor widget application menu accelerators that conflict
with these translations.Add the following line to the HomeDirectory/.Xdefaults file:#include “/usr/dt/app-defaults/language/UNIXbindings”where language is the value of the LANG environment variable.Restart your session.To Modify the EMACS-Style TranslationsInsert the contents of the file
/usr/dt/app-defaults/language/UNIXbindings into
HomeDirectory/.Xdefaults.Edit the bindings in the .Xdefaults file.Restart your session when you have finished.UNIX Bindings Provided by the UNIXbindings FileUNIXbindings fileThe /usr/dt/app-defaults/language/UNIXbindings file provides the
following bindings:The Delete key deletes the previous character when the UNIX bindings
are enabled, and Shift-Delete deletes the next character.
Note that not all vendors' keyboards supply these keys.
Please see your local vendor's documentation for alternate key bindings.
lists
the dtpad overrides for menu accelerators and accelerator text
that conflict with the UNIX bindings.
dtpad Overrides for Menu Accelerators and Accelerator TextMenu Accelerators and Accelerator TextOverrideDtpad*fileMenu.print.acceleratorText:Dtpad*fileMenu.print.accelerator:Dtpad*editMenu.undo.acceleratorText:Ctrl+_Dtpad*editMenu.undo.accelerator:Ctrl<Key>_Dtpad*editMenu.paste.acceleratorText:Shift+InsertDtpad*editMenu.paste.accelerator:Shift<Key>osfInsertDtpad*editMenu.selectAll.acceleratorText:Ctrl+/Dtpad*editMenu.selectAll.accelerator:Ctrl<Key>/
lists the dtmail Compose window overrides for menu
accelerators and accelerator text that conflict with the UNIX bindings.
dtmail Compose Window OverridesMenu Accelerators and Accelerator TextOverrideDtmail*ComposeDialog*menubar*Edit.Undo.acceleratorText:Ctrl+_Dtmail*ComposeDialog*menubar*Edit.Undo.accelerator:Ctrl<Key>_Dtmail*ComposeDialog*menubar*Edit.Paste.acceleratorText:Shift+InsertDtmail*ComposeDialog*menubar*Edit.Paste.accelerator:Shift<Key>osfInsertDtmail*ComposeDialog*menubar*Edit.Find/Change.acceleratorText:Ctrl+SDtmail*ComposeDialog*menubar*Edit.Find/Change.accelerator:Ctrl<Key>s
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+commabackward-wordCtrl+Shift+commaforward-wordCtrl+periodforward-wordCtrl+Shift+periodbackward-wordCtrl+Returnend-of-fileCtrl+Shift+Returnbeginning-of-fileGNU 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). lists the DtEditor.text Translations
Administering Fonts2fontsadministeringUsing the Style Manager Font dialog box, you can select the font size you want
for all applications. You can also specify fonts on the command line or use
resources to:Set font resources for individual applicationsAssign different fonts to be used by the Font dialog boxA 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 fontfontsbitmappedfontsbitmapped
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.fontsX Logical Font DescriptionX Logical Font DescriptionSetting Desktop Font Resourcesresourcesfontsfontsresources, settingThe Style Manager Font dialog box enables you to set fonts (up to seven sizes)
for things such as text entry and labels.Resources Set by the Font Dialog BoxFonts dialog boxWhen a font is selected, the following resources are written to the
RESOURCE_MANAGER property:SystemFont is used for system areas, such as menu bars, menu panes,
push buttons, toggle buttons, and labels. The following resource is set by
SystemFont:*FontListDisplayed in system areas of desktop clients and other
clients created using the Motif toolkit.UserFont is used for text entered into windows. The following resources
are set by UserFont:*FontFont resourceSupports earlier versions of X applications*FontSetFontSet resourceThe primary setting*XmText*FontListXmText*FontList resourceDisplayed in text entry boxes*XmTextField*FontListXmTextField*FontList resourceDisplayed in text entry boxesResources 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.NumFontsNumFonts resourcefontsnumber of in Style ManagerNumber of font sizes in the Font dialog boxSystemFont[1-7]fontssystem, in Style ManagerUp to seven resources assigning a specific font to a
Font dialog box selection for SystemFontUserFont[1-7]fontsuser, in Style ManagerUp to seven resources assigning a specific font to a
Font dialog box selection for UserFontThe 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, seethe DtStdAppFontNames (5)
and DtStdInterfaceFontNames (5) man pages.To List Available Fontsfontslisting availableType the following:xlsfonts [-options] [-fn pattern]xlsfonts commandA list of XLFD names and font alias names available on your system is
displayed. Bitmap fonts show values in all fourteen XLFD fields. Scalable
typefaces show zeros in the PixelSize, PointSize, ResolutionX, and ResolutionY
positions.To check for specific fonts, use the pattern-matching capability of
xlsfonts. Use wildcards to replace the part of the pattern you are not
trying to match.If xlsfonts does not show any font names starting with dt, your font path
does not include the desktop fonts. Type the following command to include
the desktop fonts into your available fonts:xset +fp directory namewhere directory name is the directory containing the desktop fonts. The
default location set by session startup is
/usr/dt/config/xfonts/language.For additional information, see:The xset and xlsfonts man pages list the available options.Using the X Window System explains font alias names and the xset client.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)fontsX Logical Font DescriptionA 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.
lists font property string
specifications.The form of the property string specification is:fontsspecifying property string“-Foundry-FamilyName-WeightName-
Slant-SetwidthName-AddStyleName-PixelSize-
PointSize-ResolutionX-ResolutionY-Spacing-
AverageWidth-CharSetRegistry-CharSetCoding”
Font Property String SpecificationProperty StringDefinitionFoundryA string identifying the font designerFamilyNameA string identifying the trademarked name of the fontWeightNameA string giving the relative weight of the font, such as boldSlantA code describing the direction of slantR (Roman–no slant)I (Italic–slant right)O (Oblique–slant right)RI (Reverse Italic–slant left)RO (Reverse Oblique–slant left)SetwidthNameA string describing the width, such as compressed or expandedAddStyleNameA string providing any additional information needed to
uniquely identify the fontPixelSizeAn integer giving the size of an em-square in pixelsPointSizeAn integer giving the size of an em-square in decipointsResolutionXAn integer giving the horizontal resolution in pixelsResolutionYAn integer giving the vertical resolution in pixelsSpacingA code specifying the spacing between unitsM (Monospace--fixed pitch)P (Proportional space--variable pitch)C (Character cell)AverageWidthAn integer giving the average width in 1/10th pixelsCharSetRegistryA string identifying the registration authority that has
registered the font encodingCharSetEncodingA string identifying the character set in the specified registry
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-1It 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-*Administering ColorscolorsadministeringThis section describes:How Style Manager sets display colors.Resources used by Style Manager to control desktop color usage.Color Palettespalettescolor palettescolorspalettesA palette consists a group of color sets. The color sets for the current palette are
shown in the Style Manager Color dialog boxA file exists for each palette. The paletteDirectories resource specifies the
directories containing palette files. By default, this resource contains:color setsBuilt-in palettes: /usr/dt/palettesSystem-wide palettes: /etc/dt/palettesPersonal palettes: HomeDirectory/.dt/palettesColor Setscolor setscolorscolorsetsEach 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.Color set ID values for HIGH_COLORcolorsresourcesEach 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:colorcolor setsforeground resourceforegroundThe 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 resourcebackgroundThe background of the application or the window
frame.topShadowColor resourcetopShadowColorThe color of the top and left bevels of application
controls (such as push buttons) and window
frames.bottomShadowColor resourcebottomShadowColorThe color of the bottom and right bevels of
application controls and window frames.selectColor resourceselectColorThe 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 ValuescolorsvaluesStyle Manager usesRGB values
RGB values when writing color information to its palette
files. The syntax for RGB numbers is:#RedGreenBlueRed, 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
Style Managerusing to specify colorsRGB color valueIf you set a color resource directly, you can use either the color name or RGB
value. The file /usr/lib/X11/rgb.txt file
rgb.txt lists all the named colors.How Color Sets are Mapped to Resourcescolor setsmapping to display elementsThe desktop maps color sets to various display elements through resources,
and makes the following assignments:ResourceDisplay elementactiveColorSetIdactiveColorSetId resourceActive window frame colorcolorsactive window frameinactiveColorSetIdinactiveFrameColorId resourceInactive window frame colorcolorsinactive window frametextColorSetIdtextColorSetId resourceText entry areascolorstext entry areasprimaryColorSetIdprimaryColorSetId resourceApplication's main background areascolorsapplication windowssecondaryColorSetIdsecondaryColorSetId resourceApplication's menu bar, menus, and dialog
boxesThese 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 Assignmentscolor setsdefaultcolorsdefaultThe color set IDs used for display elements depends on the Number of Colors
setting in Style Manager:High color (8 color sets)—Style Manager setting More Colors for Desktop:Color set IDDisplay element1Active window frame color2Inactive window frame color3Unused (by default)4Text entry areas5Application's main background areas6Application's menu bar, menus, and dialog boxes7Unused by default8Front Panel backgroundMedium color (4 color sets)—Style Manager setting More Colors for
Applications:Color set IDDisplay element1Active window frame color2Inactive window frame color3Application and Front Panel background color4Text entry areasLow color (2 color sets)—Style Manager setting Most Colors for
Applications.Color set IDDisplay element1Active window frame, workspace selection buttons2All other display elementsControlling Color with Style Managercolorcontrolling, 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, appdefaults, and resources built into the
application.Clients can specify primaryColorSetId resourceprimaryColorSetId and secondaryColorSetId resourcesecondaryColorSetId
resources to use certain colors within a desktop palette.Number of Colors Used by Style Managercolorsnumber usedThe number of colors used by Style Manager depends on the values for the
following resources:colorUsecolorUse resourceConfigures the number of colors the desktop usesshadowPixmapsDirects the desktop to replace the two shadow colors
with pixmapsforegroundColorSpecifies if the foreground color changes dynamically.dynamicColordynamicColor resourceControls whether applications change color when you
switch palettes. lists the maximum number of colors allocated by the desktop.display colorsmaximum number allocatedcolormaximum number allocated
Number of Desktop ColorsDisplayMaximum
Number of ColorsNumber Derived
FromB_W2Black and whiteLOW_COLOR12Two color sets
times five colors
plus black and
whiteMEDIUM_COLOR22Four color sets
times five colors
plus black and
whiteHIGH_COLOR42Eight color sets
times five colors
plus black and
white
To determine the maximum number of colors:Multiply the number of color sets in the palette by the number of colors
within each color set.Add 2 (for black and white).However, with the following configuration you would only have ten colors in
your palette: four color sets times two colors in each set (background and
selectColor) plus black and white:*colorUse: MEDIUM_COLOR
*shadowPixmaps: True
*foregroundColor: White
Multi-color icons use fourteen additional colors.colorUse ResourcecolorUse resourceresourcescolorUsecolorUse 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.HIGH_COLORMEDIUM_COLORLOW_COLORValueDescriptionB_W“Black and White” Style Manager setting
Displays with 1 to 3 color planes
Number of color sets: 2
Maximum number of colors: 2
Default number of colors: 2
No multicolor iconsLOW_COLOR“Most Color for Applications” Style Manager setting
Displays with 4 to 5 color planes
Number of color sets: 2
Maximum number of colors: 12
Default number of colors: 12
No multicolor iconsMEDIUM_COLOR“More Colors for Application” Style Manager setting
Displays with 6 color planes
Number of color sets: 4
Maximum number of colors: 22
Default number of colors: 22
Multicolor iconsHIGH_COLOR“More Colors for Desktop” Style Manager setting
Displays with 7 or more color planes
Number of color sets: 8
Maximum number of colors: 42
Default number of colors: 42
Multicolor icons\defaultThe desktop chooses the correct value for that display.
(To reduce the number of colors used by the desktop
for high-color displays, the default colorUse resource
is set to MEDIUM_COLOR.)shadowPixmaps ResourceshadowPixmaps resourceshadowPixmaps resourceresourcesshadowPixmapsThe 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.colorcreating shades with shadowPixmaps resourcesValueDescriptionTrueThe desktop creates a topShadowPixmap and
bottomShadowPixmap to use instead of the shadow
colors.FalsetopShadowColor and bottomShadowColor from
the palette are used.The default value for shadowPixmaps depends on the colorUse resource
you have and the hardware support for the display.foregroundColor ResourceforegroundColor resourcecolorspecifying foregroundThe foregroundColor resource specifies how the foreground is configured
in a palette.foregroundColor resourceresourcesforegroundColorSettingResultWhiteForeground is set to white.BlackForeground is set to black.Dynamic(Default) Foreground is dynamically set to black or white,
depending on the value of background. For instance, white
letters on a yellow background are difficult to read, so the
system chooses black.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 ResourcedynamicColor resourcedynamicColor resourceThe dynamicColor resource controls whether applications change color
dynamically; that is, whether the clients change color when you switch
palettes.colorcontrolling, with dynamicColor resourceValueDescriptionTrueClients change color dynamically when a new palette
is selected. This is the default value.FalseClients do not change color dynamically. When a new
palette is selected, clients will use the new colors when
the session is restarted.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.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 Windowsresourcesshadow thickness of windowsshadow thickness, 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 (or later) 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 (or later) applications:Log in as root.Create the /etc/dt/config/language/sys.resources file.Specify the application-specific resource in
/etc/dt/config/language/sys.resources as follows:application_class_name*XmCascadeButton*shadowThickness: 1For more information about overriding system default resources and
specifying additional resources for all desktop users, see