Solution: Individual Glyph Selection
To select a subset of a certain font, I propose the following
font.style attribute:
<source-list> ':' <dest-list>
where
source-list ::= <HTML character> [ <source-list> ]
dest-list ::= <character-version> [ <dest-list> ]
character-version ::= <HTML character> | [ <HTML Character> ] '<' <Version> '>'
| '\' <Quoted-character>
A blank (' '), backslash ('\'), comma (','), or colon (':') in either
list could be quoted by preceding it with a backslash. < and > could
not be replaced, although < and > could.
Alternatively the entire list could be enclosed in double quotes : "list"
Quoted-character can be any ASCII character, HTML character, or the
code '0x' followed by a three-digit octal character code.
Version is a number, with 0 being the default. A number too large for
the current font would be treated like 0.
Examples:
font.style = &:&<3>
(Replaces ampersand with an alternate)
(Given that the current font has two lower-case `a' entities)
font.style = æ:ae
font.style = æ:a<0>e
(would replace ae ligature with default a followed by e.)
font.style = æ:a<1>e
(same as above, but uses second 'a')
font.style = (C):© (c):©
(Useful, replaces (C) (Copyright) with the HTML entity, and older
browsers that don't understand © can still present readable text!)
font.style = Ae:Æ (Replaces initial A followed by e with
ligature.)
font.style = ffl:\0x137 (Replaces ffl with a character from the
current font, probably an appropriate ffl ligature.)
font.style = >=:"greater than or equal to"
(Spells out that ugly arrow.)
font.style = U:V u:v ":,":; \,\,\,:...
(Odd one... replaces U with V, ":," with ";", and ",,," with "...".
NOTE: It is implicit in this definition that the replacements are
carried out in the order listed.
===================================================================
Another case: what if I want all occurences of a particular product
name to appear with a given attribute combination? There is no
<PRODNAME> tag I could subclass to change the font style, although an
<EM> *might* work... what if I want all occurences of a certain word
to appear in small caps? No character-level tag I know of is a good
substitute for small caps.
Solution: Generic Character-Level Markup
Font Sub-Styles
Generic Text Entity
===================
A generic character-level text container tag in HTML 3.0 would be
extremely useful for applying styles to certain blocks of text. I propose
the following tag:
<TEXT>...</TEXT>
This element would not affect the rendering of its contents except in
conjunction with a stylesheet. Like all the character-level elements, it
could optionally have ID, LANG and CLASS attributes.
In a pinch, one *could* use <STRONG>, <I>, <B>, etc... but HTML really
needs a generic character-level tag.
FONT.FAMILY
===========
A better font-selection mechanism is also in order. I propose the
following selection method:
font.family = <font-list>
where
font-list ::= <font> [ ' ' <font-list> ]
font ::= <named> | <described>
Multiple fonts could be specified, with those listed first taking
precedence:
font.family = font:Bodoni.Win@/~luser/fonts/bodoni.ttf font:Bodoni font:Times
NAMED FONTS
===========
named ::= [ <foundry> '-' ] <font-name> [ '.' <font-encoding> '@' <location> ]
font-encoding ::= 'Windows' | 'X' | 'Mac' (etc.)
location ::= <URI> | '//' <server-name> [ '|' <X-display> ] [ '/' <specifier> ]
(Confusing, sorry...)
This specifies a particular font, optionally from a particular source,
and allows the naming of alternates. Unfortunatley, no current
windowing system can handle this inherently :). This would, for
example, allow someone to use a custom font painstakingly modeled
after a hand-calligraphed manuscript from the XIIIc by storing a copy
at some font site in a common format or even in several different
formats. If a machine address isn't specified, the local font database
is checked for a matching name. If the address is specified, the font
would be downloaded from the remote site and cached (assuming the
correct format.) The requested type foundry is ignored if the font
server doesn't allow selection on that basis. If the server does allow
selection by foundry and has a font matching in all respects except
foundry, that font is used.
Examples:
font.family = Caslon.Mac@"http://here.there.net/my folder/fonts/caslon"
font.family = Caslon
font.family =
font:Adobe-Times.X@//X.there.net|0.0/-adobe-times-*-*-*-*-*-*-*-*-*-*-*-*
(serif proportional modern)
DESCRIBED FONTS
===============
described ::= '(' <attr-list> ')'
attr-list ::= <attribute> [ ' ' <attr-list> ]
Fonts may alternatively be chosen by listing descriptive characteristics.
Possible attributes include:
serif[s]
Choose a serifed font.
sans[[-]serif[s]]
Choose a font without serifs.
extra[-]light | light | dark | medium | bold | demi[-]bold | extra[-]bold
Find a font with a certain visual weight.
italic[s] | oblique
Use an italic font.
cursive
Search for a font that looks handwritten.
ancient | old | modern | ultra[-]modern
Choose a font which conveys the specified sense of age.
fixed | variable | proportional
Use either a fixed-width or proportional (variable) font.
narrow
Find a font with unusually narrow proportions.
outline
Find a font drawn in outline.
padded
Place extra space between letters.
<lang>.<country>
Use a specified international font.
FONT.STYLE
==========
Additionally, the following attributes would be added to the
font.style element, or have their definitions changed:
small caps
All lower-case text in a small caps region would be changed to small
capital letters. All other text would be unaffected, with the
following exceptions: some punctuation (: ; ') between two lower-case
letters would be resized to match the small caps, as would lower-case
ligatures. The rendering of the lower-case letters could be affected
using caps.font.* attributes.
oversize [dropped] caps
All capital letters and dipthongs would be rendered in the
oversize.font.* attributes. If the 'dropped' keyword is specified,
the caps are all dropped below the baseline.
oversize [dropped] initial
The initial letter of the paragraph would be enlarged. Its attributes
would be controlled using oversize.font.size. The 'dropped' keyword
behaves as with oversize dropped caps.
underline[d]
Draw a line under the letters, except those in the oversize font, and
leave gaps for descenders. The color of the underline may be changed
with underline.color.
Example:
Stylesheet:
H1, P : font.family = Bodoni Times (serif proportional old)
H1 : font.style = oversize dropped caps & small caps & underline
H1 : font.style = underlined, underline.color = red
(P(TEXT.FIRST)) : font.style = oversize dropped initial & small caps
# The next line assumes that ffl is usually replaced with a ligature
# in this font.
TEXT.SEPERATE : font.style = ffl:ffl
HTML:
Rendered:
A hand-rendered version of this document is at
http://www.nmt.edu/~bsittler/images/cool.gif.
ASCII Version:
Document Title
COOL
The first few words of this document should be rendered
differently from the rest, assuming all went well... also,
whiffle should be rendered differently than whiffle. This should
be in a Bodoni or Times font.
Notice that the non-stylesheet browser doesn't have to put up with
any CAPS, since they are in the stylesheet, instead of the original
document. Nice improvement, eh?