From b3a110affa33f0a3c96e06438047913f2db90c91 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Tue, 17 Feb 2015 15:36:25 -0500 Subject: man: document font syntaxes Change-Id: Id441d4df192c47388af6b5da306f14d90f066d18 Reviewed-on: https://plan9port-review.googlesource.com/1173 Reviewed-by: Russ Cox --- man/man1/9term.1 | 3 ++ man/man1/mc.1 | 11 ++++++ man/man3/graphics.3 | 31 +++++----------- man/man4/fontsrv.4 | 3 ++ man/man7/font.7 | 105 +++++++++++++++++++++++++++++++++++++++++++++++++++- 5 files changed, 130 insertions(+), 23 deletions(-) (limited to 'man') diff --git a/man/man1/9term.1 b/man/man1/9term.1 index 33a5b05b..acff6fe9 100644 --- a/man/man1/9term.1 +++ b/man/man1/9term.1 @@ -57,6 +57,9 @@ is not given, uses the imported value of .B $font if set; otherwise it uses the graphics system default. +(See +.IR font (7) +for a full discussion of font syntaxes.) .PP .I 9term runs the given command in the window, or diff --git a/man/man1/mc.1 b/man/man1/mc.1 index 5d3d2939..e914cbab 100644 --- a/man/man1/mc.1 +++ b/man/man1/mc.1 @@ -44,3 +44,14 @@ is printed separately. .I lc in .IR ls (1) +.SH BUGS +On systems with high-DPI screens, +.I 9term +and +.I acme +do not have one current font. +They have a pair of current fonts, one font used when the window +on a low-DPI screen and one used when the window is on a +high-DPI screen. +.I Mc +always uses the low-DPI font for columnation decisions. diff --git a/man/man3/graphics.3 b/man/man3/graphics.3 index 43214f1f..a2b2d848 100644 --- a/man/man3/graphics.3 +++ b/man/man3/graphics.3 @@ -228,30 +228,14 @@ pointer that can be used by to draw characters from the font. .I Openfont does the same, but reads the description -from the named file. +from the named font. .I Freefont frees a font. -The convention for naming font files is: -.IP -.B /lib/font/bit/\fIname\fP/\fIrange\fP.\fIsize\fP.font -.PD -.PP -where -.I size -is approximately the height in pixels of the lower case letters -(without ascenders or descenders). -.I Range -gives some indication of which characters will be available: for example -.BR ascii , -.BR latin1 , -.BR euro , -or -.BR unicode . -.B Euro -includes most European languages, punctuation marks, the International Phonetic -Alphabet, etc., but no Oriental languages. -.B Unicode -includes every character for which appropriate-sized images exist on the system. +In contrast to Plan 9, font names in Plan 9 from User Space are +a small language describing the desired font. +See +.IR font (7) +for details. .PP A .I Cursor @@ -319,6 +303,9 @@ if .B $font is not set, it imports the default (usually minimal) font from the operating system. +(See +.IR font (7) +for a full discussion of font syntaxes.) The global .I font will be set to point to the resulting diff --git a/man/man4/fontsrv.4 b/man/man4/fontsrv.4 index 1aa6bcb6..7344cde9 100644 --- a/man/man4/fontsrv.4 +++ b/man/man4/fontsrv.4 @@ -78,6 +78,9 @@ recognizes font paths beginning with and implements them by invoking .IR fontsrv ; it need not be running already. +See +.IR font (7) +for a full discussion of font name syntaxes. .SH EXAMPLES List the fonts on the system: .IP diff --git a/man/man7/font.7 b/man/man7/font.7 index 4767ea16..45331d4d 100644 --- a/man/man7/font.7 +++ b/man/man7/font.7 @@ -7,7 +7,7 @@ font, subfont \- external format for fonts and subfonts Fonts and subfonts are described in .IR cachechars (3). .PP -External fonts are described by a plain text file that can be read using +External bitmap fonts are described by a plain text file that can be read using .IR openfont . The format of the file is a header followed by any number of subfont range specifications. @@ -75,6 +75,109 @@ characters of zero width (see .IR draw (3)) means that fonts should have, as their zeroth character, one with non-zero width. +.SS "Font Names +.PP +Font names in Plan 9 from User Space are +a small language describing a font. +The most basic form is the name of an existing bitmap font file, +following the convention: +.IP +.B /lib/font/bit/\fIname\fP/\fIrange\fP.\fIsize\fP.font +.PD +.PP +where +.I size +is approximately the height in pixels of the lower case letters +(without ascenders or descenders). +.I Range +gives some indication of which characters will be available: for example +.BR ascii , +.BR latin1 , +.BR euro , +or +.BR unicode . +.B Euro +includes most European languages, punctuation marks, the International Phonetic +Alphabet, etc., but no Oriental languages. +.B Unicode +includes every character for which appropriate-sized images exist on the system. +.PP +In Plan 9 from User Space, the font files are rooted in +.B $PLAN9/font +instead of +.BR /lib/font/bit , +but to keep old references working, paths beginning with +.B /lib/font/bit +are interpreted as references to the actual font directory. +.PP +Fonts need not be stored on disk in the Plan 9 format. +If the font name has the form +.BR /mnt/font/\fIname\fP/\fIsize\fP/font , +.I fontsrv +is invoked to synthesize a bitmap font from the operating system's installed vector fonts. +The command +.B fontsrv +.B -p +.B . +lists the available fonts. +See +.IR fontsrv (4) +for more. +.PP +If the font name has the form +.BR \fIscale\fP*\fIfontname\fP , +where +.I scale +is a small decimal integer, the +.I fontname +is loaded and then scaled by pixel repetition. +.PP +The Plan 9 bitmap fonts were designed for screens with pixel density around 100 DPI. +When used on screens with pixel density above 200 DPI, +the bitmap fonts are automatically pixel doubled. +Similarly, fonts loaded from +.IR fontsrv (4) +are automatically doubled in size by varying the effective +.I size +path element. +In both cases, the effect is that a single font name +can be used on both low- and high-density displays (or even in a window moved between differing displays) +while keeping roughly the same effective size. +.PP +For more control over the fonts used on low- and high-density displays, +if the font name has the form +.BR \fIlowfont\fP,\fIhighfont\fP , +.I lowfont +is used on low-density displays and +.I highfont +on high-density displays. +In effect, the behavior described above is that the font name +.IP +.B /lib/font/bit/lucsans/euro.8.font +.PD +.PP +really means +.IP +.B /lib/font/bit/lucsans/euro.8.font,2*/lib/font/bit/lucsans/euro.8.font +.PD +.PP +and similarly +.IP +.B /mnt/font/LucidaGrande/15a/font +.PD +.PP +really means +.IP +.B /mnt/font/LucidaGrande/15a/font,/mnt/font/LucidaGrande/30a/font +.PD +.PP +Using an explicit comma-separated font pair allows finer control, such as +using a Plan 9 bitmap font on low-density displays but switching to +a system-installed vector font on high-density displays: +.IP +.B /lib/font/bit/lucsans/euro.8.font,/mnt/font/LucidaGrande/30a/font +.PD +.PP .SH FILES .TF \*9/font/* .TP -- cgit v1.2.3