Log in

View Full Version : TTF Font File on Website doesn't work...



ReMaX
11-09-2007, 03:29 PM
Hi people,
need help! I put that in a stylesheet

@font-face {
font-family: "Bell Centennial Sub-Caption BT";
src: local("Bell Centennial Sub-Caption BT"),
url("font/BELCESUB.TTF")
format("TrueType"); }
but it doesn't work except if I open a font program having the font installed on my computer. Does anybody have a solution?!

greetings
Max

jscheuer1
11-09-2007, 03:59 PM
If this is for the web, forget about it. You have no control over the fonts other users have installed. If it is only for your local use, make sure that the font is installed on your computer as available to all programs, or at least to the browser(s) you are using, and use a normal font declaration, like:


body {
font-family:"Bell Centennial Sub-Caption BT";
}

ReMaX
11-09-2007, 07:54 PM
It is for the web and that's why there is an attribute called "src: url(...)" but for some reason it doesn't work. I've already checked the path. Anybody else an idea?

Twey
11-09-2007, 08:07 PM
I believe that this form of font embedding is not yet supported in most browsers.

jscheuer1
11-09-2007, 08:19 PM
I believe that this form of font embedding is not yet supported in most browsers.

Even if it were, I doubt local, as in:


src: local("Bell Centennial Sub-Caption BT"),

would cut it for a live page.

ReMaX, where did you find out about this technique? Here's the specification:

http://www.w3.org/TR/REC-CSS2/fonts.html#font-descriptions

If you provide a fall-back generic face, as instructed at the above link, at least those browsers without support for the technique will render something of your choosing. Also, you will note that the src cannot be local for a live implementation.

ReMaX
11-09-2007, 11:33 PM
Thanks for your answers but it really doesn't work. Only if I have installed the font! Perhaps I did not understand it very well :rolleyes: . Once again, here is the Code - what I really need of it, right.


@font-face {
font-family: "BellCent SubCap BT";
src: url("font/BELCESUB.TTF"); }
body {
font-family: "BellCent SubCap BT"; }

...by the way, I think I've found this technique on a selfhtml page. There is a plethora (:D ) of knowledge about html and css but they're not up to date and do not fullfill the rules of w3c in every way.

Twey
11-09-2007, 11:38 PM
It's true. However, as I've said, while this is fine according to the specification, it hasn't been implemented in most major browsers yet.

jscheuer1
11-10-2007, 01:20 AM
Thanks for your answers but it really doesn't work. Only if I have installed the font!

If you were to carefully read the specification, I believe you would find that is one of several levels of support browsers may afford this technique.

truefontfamily
11-15-2007, 01:35 PM
Webkit is one of the first browsers supporting Web fonts. Meaning you can use @font-face in your CSS. With older browsers you can still do this when you install True Font Family (http://www.truefontfamily.com/). You do need a PHP server with GD (comes standard from version 4.3). Another alternative would be sIFR.

True Font Family is a commercial product. However, even though this is a blatant plug, I am leaving the link intact, as it is very much on topic. If however, I see references to this product in less appropriate locations around the forum, the link will be removed and the user issued infraction points, possibly banned.

Twey
11-15-2007, 09:25 PM
Both alternatives require Javascript, and use images (seriously harming accessibility and probably wrecking your page layout in many browsers/setups).

TFF also doesn't appear to work on Konqueror.

P.S. it took me eleven minutes to break your pro version. Either you're good, or it's because I just woke up. I'm impressed.

truefontfamily
11-17-2007, 07:55 PM
I'd like to point out that there is a free version also. But thanks for letting my post in tact.

As with all JavaScript, the JavaScript of the pro version can be 'cracked', but without the server-side PHP code you'll still have the free version rendering capabilities. Using someone elses pro version is not possible when the security is set correctly. I think 11 minutes for the JavaScript is very fast, so thanks for the compliment, but compliments to you too. :)

TFF and sIFR require JavaScript. There is also server side solution that works without JavaScript called P+C DTR. I still think my solution is more 'natural' while it works through 100% valid CSS.

The site is still readable and accessible since most screen readers don't render JavaScript and when your browser has no image capabilities it doesn't start at all. Search engines can still read your HTML since their crawlers don't do JavaScript either.

I haven't had the change to test my code on a Mac since I don't own or have access to one. Also I haven't tried Konqueror yet. Must be some minor adjustments since most of the code is complient with early versions of ECMAScript.

Twey
11-17-2007, 08:16 PM
As with all JavaScript, the JavaScript of the pro version can be 'cracked', but without the server-side PHP code you'll still have the free version rendering capabilities. Using someone elses pro version is not possible when the security is set correctly.Then why bother obfuscating it at all? If your code is well-written and hints at features available, then it will promote the full product -- a "teaser" if you will.
I think 11 minutes for the JavaScript is very fast, so thanks for the compliment, but compliments to you too. :)Thank you -- we see so many examples of pointless and ineffective Javascript obfuscation here that I've started viewing them as a time trial :p
TFF and sIFR require JavaScript. There is also server side solution that works without JavaScript called P+C DTR. I still think my solution is more 'natural' while it works through 100% valid CSS.I do agree that the interface to your solution is very elegant, but I take issue with the accessibility of it again:
The site is still readable and accessible since most screen readers don't render JavaScript and when your browser has no image capabilities it doesn't start at all. Search engines can still read your HTML since their crawlers don't do JavaScript either.The image-replaced text is not resizable like real text. It also makes it difficult to use text-based features like Opera's double-click menu. Somewhat less importantly, it can also increase the bandwidth required to download the "text" a thousandfold.
I haven't had the change to test my code on a Mac since I don't own or have access to one.Safari is now available for Windows.
Must be some minor adjustments since most of the code is complient with early versions of ECMAScript.That doesn't necessarily mean that it will be compliant with many versions of Javascript, however, or the other extensions it uses, such as the DOM.

truefontfamily
11-18-2007, 12:17 PM
You're right about the text resizing. You could increase text size, but then you'll have to reload the page again for the script to adjust the sizes used in the images. Copy paste of replaced text is still possible in Firefox but most other browsers don't do that.

In the end there is only one real solution and that is that browsers should start implementing support for other fonts, but there are a lot of issues on copyrights and large font file downloads etc. We'll see how it further develops now that Webkit has @font-face support.

BTW. Safari works like a charm, got it installed on my computer. Great browser if you ask me, real fast also.

I am looking into Konqueror, installing Coop Linux as we speak. :-)
Tried Swift 0.99 but that's terrible. Uninstalled it right away.