Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Selecting font size based on available font

Reply
Thread Tools

Selecting font size based on available font

 
 
dave richards
Guest
Posts: n/a
 
      02-19-2004
Hi,

I'm currently trying to learn css/html and am having difficulties with font
sizes. The site loads a background with an image of a circle. All of the
content needs to fit inside this circle and I have used a div to contain the
content.

in my css I listed a number of fonts (the site needs a font that looks like
handwriting).

body {
font-family: "Monotype Corsiva","Comic Sans MS", "Cursive";
font-size:16px;
color: #505050;
margin-top: 10px;
margin-bottom: 10px;
margin-left: 10px;
margin-right: 10px;
}

The problem I have is that although 16px font size looks fine for "Monotype
Corsiva", if this font is not available and another is selected the text
either looks very compact or spills off the end of the div. I have tried
px/pt/em for the font size. Is there anyway to either specifically set the
font height to a set number of pixels or use a different font size depending
on which font is selected.

Thanks for your help
Dave



 
Reply With Quote
 
 
 
 
kchayka
Guest
Posts: n/a
 
      02-19-2004
dave richards wrote:
>
> I'm currently trying to learn css/html and am having difficulties with font
> sizes. The site loads a background with an image of a circle. All of the
> content needs to fit inside this circle


It _needs_ to fit? I have seen many attempts to fit textual content
within the confines of a fixed size background image, but don't recall
any that were really successful. You cannot reliably acheive this using
just HTML and CSS because you have no control over the visitor's fonts
or text size.

That's the nature of web media, and it is A Good Thing(TM). Start
accepting it now and you will save yourself oodles of frustration later.
It will also make you a better web designer.

> in my css I listed a number of fonts (the site needs a font that looks like
> handwriting).
>
> body {
> font-family: "Monotype Corsiva","Comic Sans MS", "Cursive";


It _needs_ to look like handwriting? Cursive fonts are generally hard
to read on screen. They can be OK for headings (if they are a
sufficiently large font size), but not for body text.

> font-size:16px;


Per accessibility guidelines, do not use px for font sizes, but
something relative to the user's preferred default text size. I highly
recommend % units.

BTW, my default text size is larger than 16px, so you just made a font
that was already hard to read on screen even more difficult, perhaps
even unreadable. I would likely have to zoom text to read it at all,
which would probably mess up your layout. That's the nature of the web.

Ask yourself who is the site for, you or your visitors? Based on your
answer, you may want to reconsider what you really _need_.

--
Reply address is a bottomless spam bucket.
Please reply to the group so everyone can share.
 
Reply With Quote
 
 
 
 
Paul Furman
Guest
Posts: n/a
 
      02-19-2004
dave richards wrote:

> Hi,
>
> I'm currently trying to learn css/html and am having difficulties with font
> sizes. The site loads a background with an image of a circle. All of the
> content needs to fit inside this circle and I have used a div to contain the
> content.



Is it possible to set the image and div size in ems to they match the
text? Probably not perfectly predictable but with some slack it might
work in most cases. I don't know how weird the picture would look
stretched... better than things spilling over.

 
Reply With Quote
 
 
 
Reply

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
creating font with fixed font size andreasbell Software 1 08-30-2010 09:39 PM
Swing Font, it's Java Font? ot native? how install new font? mttc Java 2 07-03-2009 07:29 PM
Printing with specific font-type and font-size wial Java 2 11-27-2008 05:30 PM
Windows XP explorer font and font size Lookout Computer Support 0 06-04-2006 02:58 AM
physical font specified but true type font file not available Michael Glavitsch Java 1 07-15-2003 07:09 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57