[comp.windows.x] Help with X11R4 Fonts

mitch@HQ.AF.MIL (Mitch Wright) (12/08/90)

This is probably a silly question, but...

I just finished installing X11R4 on my Sun386i at home and have been trying to
get an xterm to use a different font.   I have used the "-fn" option with
millions of different arguments as well as using xfontsel.  If I select a font
such as Times, the spacing (of spaces) are WAY off.

So my question is:  How can I use different fonts in an xterm and have it
		    useable?

Please reply via E-mail, since our USENET feed is currently down.

  ~mitch

(W):  mitch@hq.af.mil (Mitch Wright) | The Pentagon, 1B1046 | (703) 695-0262
(H):  mitch@oz.com

melby@daffy.yk.Fujitsu.CO.JP (John B. Melby) (12/10/90)

Typically, xterm-based clients (including kterm) expect fixed-width fonts,
such as a14.  Each character displayed by xterm is assumed to have a width
of one em (in the literal sense), and in the interest of speed, strings of
characters are displayed as strings.  Hence, the disparity between
position-based output and proportional string output causes the spacing
to go screwy.

-----
John B. Melby
Fujitsu Limited, Machida, Japan
melby%yk.fujitsu.co.jp@uunet

mouse@LARRY.MCRCIM.MCGILL.EDU (12/10/90)

> I just finished installing X11R4 on my Sun386i at home and have been
> trying to get an xterm to use a different font.   I have used the
> "-fn" option with millions of different arguments as well as using
> xfontsel.  If I select a font such as Times, the spacing (of spaces)
> are WAY off.

xterm does not behave at all well with a non-fixed-width font.  You
really need a character-cell font to get proper behavior out of it,
though any fixed-width font will mostly work.

The spacing is indicated by the letter marked in the example below:
                                         v
-adobe-times-bold-i-normal--10-100-75-75-p-57-iso8859-1

Here is what the XLFD has to say about this field.  xterm, and most
other terminal-emulator clients, assume a character-cell font, though
most of them will work with varying degrees of success with monospaced
or proprtional fonts.

3.1.2.11.  SPACING : code-string

SPACING is a code-string that indicates the escapement class of the
font, i.e., monospace (fixed pitch), proportional (variable pitch), or
charcell (a special monospaced font that conforms to the traditional
data processing character cell font model).

_________________________________________________________________
Code    English Translation   Description
_________________________________________________________________
``P''   Proportional          A font whose logical character widths
                              vary for each glyph.  Note that no other
                              restrictions are placed on the metrics of
                              a proportional font.
``M''   Monospaced            A font whose logical character widths are
                              constant (i.e., all char widths of the
                              font are equal to max_bounds.width).  No
                              other restrictions are placed on the
                              metrics of a monospaced font.
``C''   CharCell              A monospaced font which follows the
                              standard typewriter character cell model
                              (i.e., the glyphs of the font can be
                              modeled by X clients as ``boxes'' of the
                              same width and height which are imaged
                              side by side to form text strings, or top
                              to bottom to form text lines.  By
                              definition, all glyphs have the same
                              logical character width, and no glyphs
                              have ``ink'' outside of the character
                              cell - there is no kerning (i.e., on a
                              per-char basis with positive metrics: 0
                              <= left-bearing <= right-bearing <=
                              width; with negative metrics: width <=
                              left-bearing <= right-bearing <= 0) - and
                              the vertical extents of the font do not
                              exceed the vertical spacing (i.e., on a
                              per char basis: ascent <= font-ascent and
                              descent <= font-descent).  The cell
                              height = font-descent + font-ascent, and
                              width = AVERAGE_WIDTH.
_________________________________________________________________

					der Mouse

			old: mcgill-vision!mouse
			new: mouse@larry.mcrcim.mcgill.edu

fgreco@dprg-330.GOVt.shearson.COM (Frank Greco) (12/14/90)

> 
> I just finished installing X11R4 on my Sun386i at home and have been trying to
> get an xterm to use a different font.   I have used the "-fn" option with
> millions of different arguments as well as using xfontsel.  If I select a font
> such as Times, the spacing (of spaces) are WAY off.
> 
> So my question is:  How can I use different fonts in an xterm and have it
> 		    useable?

	Simple question. Simple answer.  You can only use *mono*-spaced fonts
	in your xterm.  Xterm is not "proportional-spaced-fonts" knowledgeable
	(no reason to be actually).

	Times is a proportional-spaced font face.  Try courier, lucidasanstypewriter,
	terminal-bold, any of the nXn "fonts" (eg, 8X13, 7X14), etc.

	If you really want to edit with all sorts of fonts, you'll have to
	get a third-party package like Framemaker.



	Frank G.

	BTW, Instead of a cmd line arg, you could set your xterm's font via a resource too:

	In some file (say ".Xdefaults")

		xterm*font:	8X13

	and "xrdb -load .Xdefaults" upon X startup.

etaylor@wilkins.iaims.bcm.tmc.edu (Eric Taylor) (12/15/90)

In article <9012141433.AA21913@islanders.>, fgreco@dprg-330.GOVt.shearson.COM (Frank Greco) writes:
|> > 
|> > I just finished installing X11R4 on my Sun386i at home and have been trying to
|> > get an xterm to use a different font.   I have used the "-fn" option with
|> > millions of different arguments as well as using xfontsel.  If I select a font
|> > such as Times, the spacing (of spaces) are WAY off.
|> > 
|> > So my question is:  How can I use different fonts in an xterm and have it
|> > 		    useable?
|> 
|> 	Simple question. Simple answer.  You can only use *mono*-spaced fonts
|> 	in your xterm.  Xterm is not "proportional-spaced-fonts" knowledgeable
|> 	(no reason to be actually).
|> 
|> 	Times is a proportional-spaced font face.  Try courier, lucidasanstypewriter,
|> 	terminal-bold, any of the nXn "fonts" (eg, 8X13, 7X14), etc.
|> 
|> 	If you really want to edit with all sorts of fonts, you'll have to
|> 	get a third-party package like Framemaker.
|> 
|> 
|> 
|> 	Frank G.
|> 
|> 	BTW, Instead of a cmd line arg, you could set your xterm's font via a resource too:
|> 
|> 	In some file (say ".Xdefaults")
|> 
|> 		xterm*font:	8X13
|> 
|> 	and "xrdb -load .Xdefaults" upon X startup.

Think of how xterm is supposed to work.  All
characters are x-y addressable.  This is not possible
if the font is not of fixed width.
--
					Eric Taylor
					Baylor College of Medicine
					etaylor@wilkins.bcm.tmc.edu
					(713) 798-3776