Prima

 view release on metacpan or  search on metacpan

pod/Prima/X11.pod  view on Meta::CPAN

corresponding sections ). It is an arguably useful feature to map all widget
properties onto XRDB, but Prima does not implement this, primarily because no
one asked for it, and also because this creates unnecessary latency when
enumeration of all properties for each widget takes place.

All global settings have identical class and name, varied in the case of the
first letter. For example, to set C<Submenudelay> value, one can do it either
by

   Prima.Submenudelay: 10

or

   Prima.submenudelay: 10

syntax. Despite that these calls are different, in a way that one reaches for
the whole class and another for the name, for the majority of these properties it
does not matter. To avoid confusion, for all properties their names and class
are given as C<PropertyClass.propertyname> index.

=head1 Fonts

=head2 Default fonts

Prima::Application defines set of C<get_default_XXX_font> functions, where each
returns some user-selected font, to be displayed correspondingly in menu,
message, window captions, all other widgets, and finally a default font. While
in other OS'es these are indeed standard configurable user options, raw X11
doesn't define any. Nevertheless, as the high-level code relies on these,
corresponding resources are defined. These are:

=over

=item *

font - Application::get_default_font

=item *

caption_font - Application::get_caption_font. Used in C<Prima::MDI>.

=item *

menu_font - Widget::get_default_menu_font. Default font for pull-down and
pop-up menus.

=item *

msg_font - Application::get_message_font. Used in C<Prima::MsgBox>.

=item *

widget_font - Widget::get_default_font.

=back

All of the global font properties can only be set via C<Prima> class, no
application name is recognized. Also, these properties are identical to
C<--font>, C<--menu-font>, C<--caption-font>, C<--msg-font>, and
C<--widget-font> command-line arguments.  The per-widget properties are C<font>
and C<popupFont>, of class C<Font>, settable via XRDB only:

   Prima*Dialog.font: my-fancy-dialog-font
   Prima.FontDialog.font: some-conservative-font

By default, Prima font is 12.Helvetica .

=head2 X core fonts

The values of the font entries are standard XLFD strings, the default
C<*-*-*-*-*-*-*-*-*-*-*-*-*-*-*> pattern, where each star character can be
replaced by a particular font property, as name, size, charset, and so on. To
interactively select an appropriate font, use standard C<xfontsel> program from
X11 distribution.

Note, that encoding part of the font is recommended to left unspecified,
otherwise it may clash with LANG environment variable, which is used by Prima
font subsystem to determine which font to select when no encoding is given.
This advice, though, is correct only when both LANG and encoding part of a
desired font match. In order to force a particular font encoding, the property
C<Prima.font> must contain one.

Alternatively, and/or to reduce X font traffic, one may set
C<IgnoreEncodings.ignoreEncodings> property, which is a semicolon- separated
list of encodings Prima must not account. This feature has limited usability
when for example fonts in Asian encodings result in large font requests.
Another drastic measure to decrease font traffic is a boolean property
C<Noscaledfonts.noscaledfonts>, which, if set to 1, restricts the choice of
fonts to the non-scalable fonts only.

=head2 Xft fonts

Prima can compile with Xft library, which contrary to core X font API, can make
use of client-side fonts. Plus, Xft offers appealing features as font
antialiasing, unicode, and arguably a better font syntax. The Xft font syntax
is inherited from C<fontconfig> library and to be consulted from C<man
fonts-conf>, but currently ( November 2003 ) basic font descriptions can be
composed as follows:

   Palatino-12

A font with name C<Palatino> and size 12.

   Arial-10:BI

A font with name C<Arial>, size 10, bold, italic. The C<fontconfig> syntax
allows more than that, for example, arbitrary matrix transformations, but
Prima can make use only of font name, size, and style flags.

The XFT library does internal memory management that is not necessary optimal
for text with large amount of glyphs, f.ex. chinese. If display of these text is slow,
try to increase memory for glyph caching by setting 

  Xft.maxglyphmemory: 10485760

(f.ex. for 10M per program cache) to the input for your xrdb.

=over

=item C<--no-xft>



( run in 1.343 second using v1.01-cache-2.11-cpan-364913b4093 )