Help - Search - Members - Calendar
Full Version: can you have different sizes per font?
HTMLHelp Forums > Web Authoring > Cascading Style Sheets
NovaArgon
I want this to be the first font that my page will check to see if a user has and so on.

Chiller size 170%, Georgia size 100%, sans-serif size 100%, serif size 100%

How do I do this?
Darin McGrew
CSS 2 included the font-size-adjust property, but support never materialized and it was dropped from CSS 2.1. CSS 3 may reintroduce font-size-adjust.
pandy
No, there's nothing that can do it exactly like that, but there is a property called 'font-size-adjust'.
http://www.w3.org/TR/CSS2/fonts.html#propd...ont-size-adjust
The purpose is to give whatever font the user may have the same perceivable size as your first hand choice. Note that W3C's list of aspect values there probably contains errors.

This is not supported by IE. I don't know what browsers that support it now. Earlier it was only Mozilla/FF. There's a lot of information on the web saying that NO browser supports it or that Mozilla gets it wrong, but that's simply not true. Mozilla has supported this and done it right since long before version 1. I don't know why people keep insisting the opposite. A matter if quoting eachother, I guess.

So, you can get it to work at least in FF and maybe in more browsers now.
pandy
Sorry, Darin. I didn't refer to you when I said people insist there's no support! You posted while I typed. Hmm, hope FF hasn't gone and dropped it. Must check.
NovaArgon
Thanks guys for all your advice.

I am sure not to many people are going to have chiller so It looks like i'm going to have to drop it.

Darin McGrew
Well, when CSS 2.1 came out, they wanted "at least two interoperable implementations for every feature". Plus, Firefox wasn't as widely used as it is now.

From the spec, font-size-adjust is targeted at accommodating the difference in aspect value among different fonts. But ornamental typefaces can be harder to read than their aspect value might indicate. I'm not sure how this plays out, if you're using font-size-adjust and have multiple ornamental typefaces in your preferences list. The browser is going to adjust the font sizes based on the actual aspect value, so you really can't fudge it. I think you just have to live with any non-ornamental fonts in your preferences list being displayed larger than you might otherwise want.
pandy
Yes, odd stuff can probably happen. Anyway, Gecko still supports it AND Opera and Safari also do now. That's all I tried. smile.gif
http://web.telia.com/~u18121512/font-size-adjust.html

First para - Verdana at 12px
Second para - Courier New at 12px
Third para - Courier New at 12px adjusted approximately to Verdana's aspect value.


NovaArgon, the way I've use it in that page isn't how you are supposed to use it, but I had to force things to show it in work.
Darin McGrew
There seems to be a typo in your CSS. (Also, I had to turn off my minimum font size. Is the effect easiest to see at small font sizes?)
pandy
That's what dragging text does to you. I should have validated, huh? laugh.gif Hope it's right now.
NovaArgon
Thanks so much. Does it matter if I use px or %?

I'm going to play around with it thanks so much
NovaArgon
Would you mind giving me a little more detail?

I can't get this to work my dreamweaver. I am trying to make the same block of text have the different sizes depending on if the user has the first text or not.

Like for example

My pc has Text1 and Text2 but not very many people have Text1 but everyone has Text2

At 100% Text1 is this size

Text1Text1Text1Text1Text1Text1Text1

and at 100% Text2 is this size

Text2Text2Text2Text2Text2Text2Text2

So what I am trying to do is set Text1 to 170% so that everyone one who has Text1 on there pc can see it at a large enough size but in doing this it also sets Text2 to 170% whitch makes it way way to large. It's the same paragraph. The only reason anyone would ever see Text2 is if they don't have text one.

I can only test this in dreamweaver.
NovaArgon
This was posted on a different forum but I cant get it to work.

QUOTE
I don't think that this can be achieved unless you use javascript, and with the javascript, I don't know how if you do use javascript. You'll have to find a function that can find if the font exists. But what I suggest is going in your Fonts(if you have Vista you can type this in your windows explorer: Control Panel\Appearance and Personalization\Fonts you can try it with XP too, but I don't know if it'll work). Find the font, then drag it into your FTP, you can then type something like:

CODE
font-family: 'chiller.ttf';


And that will display the font from the server, so everyone can view the same font.
NovaArgon
That didn't work... Something about php

Well maybe this http://www.mikeindustries.com/blog/sifr/

Have you guys ever heard of it?
pandy
What that guy says is wrong. You can embed fonts, but it only works in MSIE and it isn't done as easily as he describes it. You nead a special font format made with a special program and there's more to the CSS than what he posted. I wouldn't bother.

QUOTE

never heard of that.
pandy
QUOTE(NovaArgon @ Apr 23 2008, 04:04 AM) *

I can only test this in dreamweaver.


Why? Don't you have any browsers? tongue.gif No one surfs with DW preview, so why bother with what it supports and not?

How did you do it? Let's see.
NovaArgon
www.drysnot.com

I changed my images up some and set the animated ones to appear first. I think I could replace the non animated ones with text since they are now on the background but thats for another day.

As far as the text goes I'm still working on it lol I never managed to get your code to work. I think i was doing the css part wrong.
pandy
Don't find any font-size-adjust.
NovaArgon
I can't think any more its almost 4am I think i'm going to get some sleep wacko.gif

Maybe I will come up with something in my dreams lol.

I'll try some more stuff in the morning but I was thinking that if I go through the hundreds of fonts and pick out all the ones that I think look cool on my site the surly my users will be bound to have at least one of them. unsure.gif
Christian J
QUOTE(NovaArgon @ Apr 23 2008, 07:14 AM) *

That didn't work... Something about php

Well maybe this http://www.mikeindustries.com/blog/sifr/

Have you guys ever heard of it?

I've read about a similar trick, where PHP creates images with text on (so you don't need to start a graphics program in order to change the text on an image). This should only be practical for e.g. headers and similar short texts.

Regarding font embedding in MSIE, google for "WEFT".
Christian J
QUOTE(NovaArgon @ Apr 23 2008, 09:48 AM) *

if I go through the hundreds of fonts and pick out all the ones that I think look cool on my site the surly my users will be bound to have at least one of them. unsure.gif

If you know the font is installed in e.g. Win XP and/or Vista, you might use conditional comments to show the font (and a suitable font-size) to IE6/7 only. Other browsers will then get a backup font.

Probably there's some way to sniff for OS with javascript too, but I don't know how reliable it will be since browsers often spoof their identity. See e.g. http://www.quirksmode.org/js/detect.html (But like he writes himself, "If you're new to JavaScript, don't use this script.")
pandy
So people on XP and Vista don't use other browsers than IE? ohmy.gif tongue.gif
Christian J
QUOTE(pandy @ Apr 25 2008, 04:36 PM) *

So people on XP and Vista don't use other browsers than IE? ohmy.gif tongue.gif

How do you mean? If the page uses CC, non-IE browsers get the backup font. If the page uses JS to sniff for Windows, you can give all Windows browsers the font.
pandy
QUOTE
How do you mean? If the page uses CC, non-IE browsers get the backup font. If the page uses JS to sniff for Windows, you can give all Windows browsers the font.

Yeah, but what's the point in giving only IE users the first font?
Christian J
QUOTE(pandy @ Apr 25 2008, 07:31 PM) *

Yeah, but what's the point in giving only IE users the first font?

Because they use Windows (at least the IE/Win versions that support CC, as opposed to IE5/Mac), and the font is assumed to come with Windows. If the font doesn't come with Windows you might use font embedding with Weft for the same browsers.

Of course you may not consider IE's market share large enough to justify all this.
pandy
Ok. Let me rephrase. rolleyes.gif

What's the point in giving only IE users the first font and not users of other browsers on Windows? tongue.gif
Frederiek
or on Mac, for that matter tongue.gif

Since long, MS has abandonned to support Mac's biggrin.gif

Personally, I already heard about sifr and kind of like it. Though, by default, I have Flash disabled and have to click on the bloc to load it if I wish to.
Christian J
QUOTE(pandy @ Apr 25 2008, 08:18 PM) *

Ok. Let me rephrase. rolleyes.gif

What's the point in giving only IE users the first font and not users of other browsers on Windows? tongue.gif

It used to be a point when IE/Win was more popular. Perhaps those days are gone, unless you could find some other way that includes Gecko as well. But Safari and Opera are not important enough for simple decorations like this, IMO.
Frederiek
Safari is used by more and more people. Not only on Mac anymore, since it's available on PC too.
Christian J
QUOTE(Frederiek @ Apr 25 2008, 11:22 PM) *

Safari is used by more and more people.

According to http://www.upsdell.com/BrowserNews/stat.htm it's just between 1,4-4,4%. I suspect it's the lower number, since most Windows users that are tired of IE are already using Firefox. I don't think many users try (or use) many different browsers.

QUOTE
Not only on Mac anymore, since it's available on PC too.

I know, I have it myself. tongue.gif
Frederiek
Yeah well, I have a VM box with either IE6 (XP) or IE7 (Vista) too. And FF on Mac.
Still, as you know, I only surf with Safari, be it in minority at the moment, opening the VM only if I *really* have to.
NovaArgon
So would it just be easier to make an image of the paragraph and just not worry about any of the text? I could put an alt tag on it that sums it up for the blind.

Sound good?
pandy
NO. angry.gif angry.gif angry.gif

Accept the fact that all users won't see the font. If the aspect ratio is a big deal I'd use font-size-adjust since it seems like a fair number of browsers support it now.

In other words: Let it go, let it go! This is smaller than you know. No bigger than a pebble lying on a gravel road. Let it go, let it go! Got to leave it all behind you. Give the sun a chance to find you. Let it go! tongue.gif
Christian J
QUOTE(NovaArgon @ Apr 26 2008, 10:23 PM) *

So would it just be easier to make an image of the paragraph and just not worry about any of the text? I could put an alt tag on it that sums it up for the blind.

Sound good?

A whole paragraph? wacko.gif That would cause extra trouble like fixed text size (even in browsers that feature page zoom, the zoomed text would become blurred) and the page content wouldn't adapt to different browser window widths. It would also increase download time, and your bandwidth usage. If the user would like to copy the text (there could be legitimate reasons for this) that would be cumbersome. If you would like to change the text you'd both have to redo it all in a graphics program and rewrite the ALT text.
NovaArgon
You guys have a point there. I guess I'll go back to just using plan text.

Web design is a frustration job I don't see how anyone could do it for a living. Its like everything you try to do can't be done or at least not easy.
pandy
Hey man, you don't know what you're missing! You count your curses and forget about the blessings. Don't you think you should learn a little lesson. What are you waiting for? Let it go, let it go! IPB Image
Darin McGrew
Repeat after me: The web is not WYSIWYG. The web is not WYSIWYG. The web is not WYSIWYG....

I was pretty clear on this concept before I wrote my first web page, and I had experience with other document systems that rendered the same content differently depending on the capabilities of the display environment. So when I started writing web pages, I didn't have a lot of WYSIWYG habits to unlearn. A lot of the pain goes away if you stop worrying about making documents look exactly the same everywhere.

But I don't earn a living doing web design.
pandy
Oh dear. I hope everyone understands that I was quoting an old song in the last two posts above. It sort of fitted, or so I thought when I wrote it. blush.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2024 Invision Power Services, Inc.