Presentation is loading. Please wait.

Presentation is loading. Please wait.

XWN740 X-Windows Configuring and Using Fonts and X Windows (Chapter 10)‏

Similar presentations


Presentation on theme: "XWN740 X-Windows Configuring and Using Fonts and X Windows (Chapter 10)‏"— Presentation transcript:

1 XWN740 X-Windows Configuring and Using Fonts and X Windows (Chapter 10)‏

2 Agenda Working with Fonts: Why Study Fonts in X? Font Basics Core Fonts Using Fonts the Old Way Configuring Font Path Font Names Installing / Removing Fonts

3 Configuring X Windows Why Study Fonts in X? X has two font systems: one that was invented in 1984, and one that was invented in 2000. Both systems are in wide use today. We will study the old system in today's lesson. Why study fonts in X Windows? Running font servers to increase efficiency when rendering documents with fonts require knowledge of fonts. You may need the ability to add different types of fonts when clients/users request them...

4 Fonts and X Windows Font Basics A font is a description of how to display a given set of characters in a particular size, typeface, and style. It includes information about each character shape, spacing, and usage. Font sizes have traditionally been measured in points, a unit of measure now considered equal to 1/72 inch or 0.3527 mm. Line-to-line spacing (leading) is also measured in points. A typeface is a coordinated collection of glyphs or character shapes. Font styles alter the glyphs for special applications; typical styles include italic and bold.

5 Fonts and X Windows Font Basics Horizontally, a font's glyphs may be monospaced, meaning that the start of each character is the same distance from the start of the preceding and following characters, regardless of the characters. Fonts may alternately be proportionally spaced, with the amount of space adjusted to the width of the character.

6 Fonts and X Windows Font Basics Note the difference between fixed spaced and proportionally spaced fonts displayed below: Proportionally Spaced: Hello, How are you? Narrow Character: l Wide Character: W Fixed Spaced (Monospaced): Hello, How are you? Narrow Character: l Wide Character: W

7 Fonts and X Windows Font Basics Proportionally-spaced characters can also be kerned: the amount of space can be adjusted according to the combination of characters used. For example, the letters oa would be placed closer together than the characters ab, because the curved sides of the characters create the visual appearance of more space. Digital fonts can be specified in two different ways: as a bitmap (pattern of dots) or as a scalable font pattern (series of elements such as lines, arcs, and fills).

8 Fonts and X Windows Bitmapped vs. Scalable Fonts Bitmapped fonts are specific to a particular size, display resolution and style. They tend to be fairly large files and are quite inflexible, but they have the advantage of being easy to place on the screen. Scalable fonts can be rendered at any resolution and font size, and in many cases they can be rendered in different weights and styles. However, they must be rendered into an internal bitmap format before being drawn on the screen.

9 Fonts and X Windows Fonts the Old Way (Core Fonts)‏ The original X11 font system is called core fonts. It can use bitmapped fonts or (more recently) scalable fonts; these fonts are managed on the server using the X11 protocol. The problem with core fonts is that they are monochrome only, meaning they are only one color, and as a result, produce a “staircase effect” referred to as “aliasing” that give the font a blocky appearance.

10 Fonts and X Windows Defining core fonts A Font Server can be used in X windows so that catalogs of fonts can easily be made available to a large number of desktop systems (i.e. improve efficiency of rendering fonts). The xfs command is used to start the font server. The server can also find the fonts using the font path usually defined in the xorg.conf file, which can also be set or viewed using the xset command. The fonts must be on a file system that are accessible to the X server, or they must be available through a font server.

11 Fonts and X Windows Defining core fonts The font path specification for a font server takes this form: protocol/host:port/catalog The protocol is either "tcp" or "unix" (in which case the host is left blank); the port is usually 7100; and the catalog is the set of fonts to be accessed (leave the slash and catalog off to access all fonts from that font server).

12 Fonts and X Windows Font Names Core fonts are named and selected using the X Logical Font Descriptor (XLFD). This is a set of 14 fields starting with a dash and separated by dashes. Refer to section 10.4 in X Power Tools textbook for a listing of font name fields (i.e. font characteristics). X Window clients applications (such as xterm) usually allow an option to use a particular font: eg. xterm -font -bitstream-terminal-medium-*-*-*-18-*-*-100-c-*-iso8859-*

13 Fonts and X Windows Viewing / Selecting Fonts xlsfonts Used to list the font name for all installed fonts. xfontsel Used as a graphical method to preview, copy and paste font name to an application such as xterm.

14 Fonts and X Windows Installing Fonts To install fonts, you can download zipped font files to a general directory. The problem with core fonts with the long 14 field descriptors is that those long file names are incompatible with older Unix systems with a maximum filename size of 14 characters. The utilities contained in the next slides allows aliases or “nick-names” to be used to represent the larger font filenames....

15 Fonts and X Windows Installing Fonts mkfontdir Used to create a new directory to store a bitmapped font. eg. cd /usr/share/X11/fonts/100dpi mkfontdir mkfontscale Used to setup a scalable font prior to using mkfontdir. eg. cd /usr/share/X11/fonts mkfontscale mkfontdir

16 Fonts and X Windows Adding/Removing Fonts Paths xset [+fp pathname] [-fp pathname] Used to add or remove fonts from font server. A + sign before the pathname adds to the beginning of the path list, a + sign after the pathname adds to the end of the path list. You can also use = to ignore current font path and set a new value, but space must be between = and the font path.. Examples: xset +fp /newfontdirectory xset -fp /newfontdirectory xset fp= /newfontdirectory

17 Fonts and X Windows Next Lesson Although core fonts are still used by older applications, these type of fonts are starting to disappear from the X windows environment. In the next lesson, we will learn how to use a newer font system that was adopted in 2000...


Download ppt "XWN740 X-Windows Configuring and Using Fonts and X Windows (Chapter 10)‏"

Similar presentations


Ads by Google