HighDots Forums  

font default

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss font default in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #11  
Old   
Sherman Pendley
 
Posts: n/a

Default Re: font default - 08-02-2008 , 06:37 PM






dorayme <doraymeRidThis (AT) optusnet (DOT) com.au> writes:

Quote:
I am sure you plonked him a while back.
Different group. :-)

sherm--

--
My blog: http://shermspace.blogspot.com
Cocoa programming in Perl: http://camelbones.sourceforge.net


Reply With Quote
  #12  
Old   
GTalbot
 
Posts: n/a

Default Re: font default - 08-03-2008 , 01:48 AM






On Aug 2, 1:40*pm, Sherman Pendley <spamt... (AT) dot-app (DOT) org> wrote:
Quote:
Roedy Green <see_webs... (AT) mindprod (DOT) com.invalid> writes:
Is there a shortcut way to define the default font family (and
characteristics) to be applied to all styles?

Just apply it to the top-level body rule:

body { font: 1em serif }

Hello Sherman,

I definitely recommend to *_not_* use 1em and instead use 100% because
there is an important bug in IE 5, IE 6 and IE 7 which will be
triggered with font: 1em serif.

http://www.gtalbot.org/BrowserBugsSection/MSIE7Bugs/#bug79

Regards, Gérard
--
Internet Explorer 7 bugs: 159 bugs so far
http://www.gtalbot.org/BrowserBugsSection/MSIE7Bugs/


Reply With Quote
  #13  
Old   
Jukka K. Korpela
 
Posts: n/a

Default Re: font default - 08-03-2008 , 03:52 AM



Scripsit Sherman Pendley:

[...]
Quote:
Is there a shortcut way to define the default font family (and
characteristics) to be applied to all styles?

Just apply it to the top-level body rule:

body { font: 1em serif }

The question presumably refers to browser default font family. What
makes you think it is a serif font and that it is the font
corresponding to the keyword serif? Hint: You have no grounds for
that,

I think no such thing.
So you apparently weren't asking the question in its obvious meaning,
and you didn't specify which question you answered. It doesn't really
matter, since whatever the question was, within reasonable limits, your
answer was wrong.

Quote:
Elements nested in the body element will inherit its styles - that's
the C (for Cascade) in CSS.

You don't understand the "C" in "CSS". Neither do most other authors,
but this is a good reason to refrain from giving advice on CSS in
public before you have a clue.

You don't understand basic manners.
If "basic manners" includes the principle of not revealing bogus answers
in public as bogosity, I'm very happy to fail to meet your definition of
"basic manners".

Thank you for confirming your ignorance of the basics of CSS by making a
personal attack instead of even trying to defend the statements you
wrote.

Quote:
The correct answer is that the "best" one can do is
* { font-family: inherit !important; }
but this
a) isn't supported by IE
b) is ineffective against style sheets that use the !important weapon
too.

So, your "correct answer" is one that doesn't work for 70-80% of the
real users who will visit a site?
Quite correct: my answer describes the "best", i.e. the maximum of what
you can achieve in CSS, in the direction of the goal described in the
question. It seems that you have already forgotten the question, or
never understood it.

Of course, if we modify the question, we get more useful questions with
more useful answers (which don't include yours), but I will leave it to
the OP to explain what he really wants, if it still matters.

For example, if you really wanted to use the same specific font, say
Arial, with each browser's meaning for sans-serif as the fallback
option, for _all_ elements, _then_ the following is fairly effective:
* { font-family: Arial, sans-serif !important; }
Beware that this would affect elements for which such rendering would be
unnatural or risky (e.g. <code> and <pre>) and that it would not affect
the rendering of some form fields in some browsers (which present such
fields using built-in routines that are immune to CSS rules).

(It would be slightly more effective, but boring, to write a long list
of elements - all HTML elements you know of - before "*":
a, abbr, acronym, ..., xmp, * { ... } )

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/



Reply With Quote
  #14  
Old   
Jukka K. Korpela
 
Posts: n/a

Default Re: font default(s) - 08-03-2008 , 04:36 AM



Scripsit Roedy Green:

Quote:
body { font: 1em serif }

Thanks for your speedy response. I realise now that I do that
already.
Then you should do something about that problem.

Quote:
Here is a related question, which is the one I should have
asked in the first place.
We might be getting closer to your real question, and it isn't related
to the question you originally asked.

Quote:
What if you have 3 basic font-family patterns on your website?
You just decide which elements you wish them to apply to, then write
appropriate selector lists.

Quote:
e.g.

for body text
font-family: "Tiresias PCfont Z","Tiresias
PCfont",TiresiasScreenfont,"Palatino Linotype","Bookman Old
Style","Book Antiqua","Trebuchet MS","Lucida Sans","Lucida Sans
Unicode",Verdana,serif;

for title-like elements:
font-family: Calibri,"Bitstream Vera Sans","Segoe
UI",Arial,Helvetica,sans-serif;

for monospaced elements:
font-family: "Bitstream Vera Sans Mono","Lucida
Console","Lucida Sans","Lucida Sans Unicode","Courier","Courier
New","Bitstream Vera Sans","Segoe UI",Arial,monospace;
How many of the possible combinations did you actually test visually? It
seems that you have written the lists almost at random. For example,
what will happen when Verdana is used for copy text, Calibri for
headings, and Arial for "monospaced" elements? Quite a mess, I would
say.

For example, what does Verdana do in the list for body text
alternatives? It would seldom be used, since e.g. Palatino Linotype has
probably well over 90% coverage in computers, but if it were used for
some odd reason, the page appearance would be _very_ different from the
effects of most of the other fonts you're suggesting.

The Tiresias fonts are rather rarely installed, but if you have verified
that their overall appearance is similar to Palatino Linotype but even
better for your purposes, then the following would be a reasonable
starting point:

* { font-family: "Tiresias PCfont Z","Tiresias
PCfont",TiresiasScreenfont,"Palatino Linotype", serif; }

Then you just add rules for elements for which some other font is
preferred.

For title-like elements, you have too many alternatives, too. For
example, what are the odds of having Segoe UI in a system that lacks
Calibri? And what is your general strategy? If you prefer Calibri for
title-like elements, it would be natural to use Cambria or Constantia
for copy text, Consolas for monospace text, since the "C fonts" have
been designed to be used together. They are generally smaller than most
other fonts, for a given font size (!), but they match each other's
dimensions, so that e.g. Consolas text inside Cambria text looks
reasonable (whereas, in general, monospace text inside normal text too
often looks disproportional).

For example, assuming that Palatino Linotype is really your basic
preference for copy text, you should probably have something simple for
title-like elements, e.g.
h1, h2, h3, h4, h5, h6, caption, th, .caption {
font-family: Helvetica, Arial, sans-serif; }
(and you would use class="caption" for any element that you want to
appear in your "title style" but lacks natural markup, e.g. image
caption).

Quote:
Is there a way to specfy each pattern only once, then just indicate
which pattern applies to any given style?
No.

Quote:
If not, is there a way to specify the preferred font-family set you
would like to use for logical fonts monospace , sans-serif and serif?
By using a list of selectors that contains the elements you want the
font-family to be used for.

Quote:
If not, is there any way to create user-defined inheritance hierarchy
No. Inheritance works as defined in CSS specifications, and in a manner
that most people don't understand. Forget inheritance for the time
being. If you specify font-family for every element (as you would e.g.
by writing * { font-family: ... }), then no inheritance will take place
for that property.

Quote:
I heard CSS was developing constants/variables, that might be useful
to solve such a problem.
The Internet is full of rumors. This one is particularly wrong, since
the W3C has made a policy decision not to develop CSS in the direction
of a programming language. Of course, they might be somewhat
inconsistent in this matter, as others, but it would be very unrealistic
to expect CSS to develop (named) constants or variables.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/



Reply With Quote
  #15  
Old   
Sherman Pendley
 
Posts: n/a

Default Re: font default - 08-03-2008 , 10:19 AM



GTalbot <newsgroup (AT) gtalbot (DOT) org> writes:

Quote:
On Aug 2, 1:40*pm, Sherman Pendley <spamt... (AT) dot-app (DOT) org> wrote:
Roedy Green <see_webs... (AT) mindprod (DOT) com.invalid> writes:
Is there a shortcut way to define the default font family (and
characteristics) to be applied to all styles?

Just apply it to the top-level body rule:

body { font: 1em serif }


I definitely recommend to *_not_* use 1em and instead use 100% because
there is an important bug in IE 5, IE 6 and IE 7 which will be
triggered with font: 1em serif.
It was just a quick example - but still, you're right. I'd forgotten
about that bug. Thanks for the reminder.

sherm--

--
My blog: http://shermspace.blogspot.com
Cocoa programming in Perl: http://camelbones.sourceforge.net


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.