Sent by Jukka K. Korpela on 3 May 2007 22:10
On Thu, 3 May 2007, Austin, Darrel wrote:
>> Site is dynamic, and there would be far too much
>> overhead to parse all the content and append a style to any numbers
>
> Is the site run from a CMS? One could parse the content going into the
> CSS with regular expressions and wrap the numbers with Span tags.
That might be a feasible approach in some situations, and it might be
possible to use something lightweight instead of a regexp parser - after
all, this would be just about recognizing sequences of digits.
But I'm not sure how well Georgia would work with digits taken from
another font. To me, much of the charm of Georgia consists of the oldstyle
digits, so I'm biased.
>> Is there any way to use pure CSS to give font-family:Georgia;
>> to everything except numbers?
>
> There's likely a javascript solution.
To put it a bit more explicitly, there is no pure CSS solution. You would
need extra markup, or _something_ extra. There is no fundamental reason
why CSS could not contain tools for the purpose; it could have
pseudoelements that correspond to given characters or classes of
characters and strings consisting of them; it just doesn't, and won't, in
the foreseeable future.
> But it's way overkill just to
> please a silly request for the boss. I'd say your best solution is to
> just install a custom version of Georgia on your boss's computer with
> numbers they like. ;o)
In fact, customizing a font might be a real solution in _some_ situations.
Not all use of CSS means using it on the WWW. But normally we use CSS for
styling web or intranet pages, and then tweaking fonts would really be
part of new problems, not a solution.
Perhaps the boss could be persuaded into thinking that oldstyle digits are
_good_ when used in _texts_ and that you can use a different font in
numeric tables, where the requirements are different anyway. There are
borderline cases where text contains so much numeric data that it would
look somewhat odd when oldstyle digits are used. Besides, oldstyle digits
aren't really suitable for use with uppercase letters (as in "A4" or "RFC
2822"), since oldstyle digits are stylistically "lowercase digits". But
there's no simple way around such problems - adding <span> markup is
probably the easiest way and among the most reliable.
--
Jukka "Yucca" Korpela, http://www.cs.tut.fi/~jkorpela/
______________________________________________________________________
css-discuss [EMAIL-REMOVED]]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7 information -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/