This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 12 - Pages: 1 - Last Post: 17-Jan-2008 17:45 Last Post By: jGromit
CLOSED_USER

Posts: 7
Registered: 8-Feb-2007
Make personal font
Posted: 16-Jan-2008 14:03
 
  Click to reply to this thread Reply
I want use my personal font (edwardian) but i do know how put this:

CSS

.comments{
font-family:edwardian;
font-style:italic;
font-weight:500;
font-size:12px;
color:#0000ff;
}

in the slide.htt

<span class="comments">$comment</span>

i've puted the font in res folder but the code no find the font,

Edited by: Alberto on 16-Jan-2008 14:05
jGromit

Posts: 8,325
Registered: 31-Jan-2006
Re: Make personal font
Posted: 16-Jan-2008 17:15   in response to: CLOSED_USER in response to: CLOSED_USER
 
  Click to reply to this thread Reply
The font has to be installed on your PC - fonts are not picked up from the res folder. Your browser picks up the font from the installed fonts on the computer. And remember, if anyone else looks at your album, unless they have installed the same font, they will, instead, see the text in their PC's default font (probably Arial).
CLOSED_USER

Posts: 7
Registered: 8-Feb-2007
Re: Make personal font
Posted: 16-Jan-2008 23:20   in response to: jGromit in response to: jGromit
 
  Click to reply to this thread Reply
I understood, it seems myself weird than it does not be possible to put a personal font in a folder and light read in all of the browsers
jGromit

Posts: 8,325
Registered: 31-Jan-2006
Re: Make personal font
Posted: 17-Jan-2008 00:02   in response to: CLOSED_USER in response to: CLOSED_USER
 
  Click to reply to this thread Reply
Yes, it makes things very difficult for a webpage designer, since it's very difficult to know how the page will actually look for all viewers.

There is a way of providing for your font to be downloaded for the viewer, but I haven't experimented with it, so I don't know how well it works. In your CSS, you'd enter something like this:

@font-face {
        font-family: "Robson Celtic";
        src: url("http://site/fonts/rob-celt")
      }

So if the user didn't have the "Robson Celtic" font, the browser would retrieve it from a given URL. Maybe you could give the URL to the res directory:

src: url("$resPath/fonts/rob-celt")

This might be worth playing with. Search for font-face on this site.
CLOSED_USER

Posts: 7
Registered: 8-Feb-2007
Re: Make personal font
Posted: 17-Jan-2008 00:22   in response to: jGromit in response to: jGromit
 
  Click to reply to this thread Reply
This te code but no good:

.comments {
font-family: "edwardian";
src: url("$resPath/edwardian.ttf")
font-style:italic;
font-weight:500;
font-size:12px;
color:#0000ff;
}

Edited by: Alberto on 17-Jan-2008 00:23
jGromit

Posts: 8,325
Registered: 31-Jan-2006
Re: Make personal font
Posted: 17-Jan-2008 00:26   in response to: CLOSED_USER in response to: CLOSED_USER
 
  Click to reply to this thread Reply
Well, no, that's not going to work. You need to use the font-face attribute of CSS. The syntax is very precise, so you can't just improvise. You need to go to that page I linked, and do some reading.

(Bad advice removed - no sense leaving incorrect info lying around to confuse some future reader!)

Edited by: EarlyOut on 16-Jan-2008 20:31
davidekholm

Posts: 3,785
Registered: 18-Oct-2002
Re: Make personal font
Posted: 17-Jan-2008 00:48   in response to: jGromit in response to: jGromit
 
  Click to reply to this thread Reply
Actually $resPath will be interpreted nomatter if it's within quotes or not. That syntax is a very basic search & replace mechanism.
CLOSED_USER

Posts: 7
Registered: 8-Feb-2007
Re: Make personal font
Posted: 17-Jan-2008 00:49   in response to: jGromit in response to: jGromit
 
  Click to reply to this thread Reply
i've read the link, but no more good:

@font-face{
font-family: "edwardian";
src: url("$resPath/edwardian")
}

.comments{
font-family: "edwardian"
font-size:12px;
color:#0000ff;
}

side.htt:

<span class="comments">$comment</span>

Edited by: Alberto on 17-Jan-2008 00:51

CLOSED_USER

Posts: 7
Registered: 8-Feb-2007
Re: Make personal font
Posted: 17-Jan-2008 01:37   in response to: CLOSED_USER in response to: CLOSED_USER
 
  Click to reply to this thread Reply
I've resolved, this is the correct code:

@font-face{
font-family: "Edwardian Script ITC";
src: url("$resPath/edwardian")
}
 
.comments{
font-family: Edwardian Script ITC;
font-size:30px;
color:#0000ff;
}
TomCee

Posts: 385
Registered: 11-Jul-2005
Re: Make personal font
Posted: 17-Jan-2008 12:10   in response to: CLOSED_USER in response to: CLOSED_USER
 
  Click to reply to this thread Reply
Alberto,

you bring up some interestings stuff. The possibility of using a font from a specified location is from the new css2 specifications. What I would like to know is waht the requirements are from the browser side to read the css2 specifications. Anyone??

regards,
Tom

CLOSED_USER

Posts: 7
Registered: 8-Feb-2007
Re: Make personal font
Posted: 17-Jan-2008 12:20   in response to: TomCee in response to: TomCee
 
  Click to reply to this thread Reply
CLOSED_USER

Posts: 7
Registered: 8-Feb-2007
Re: Make personal font
Posted: 17-Jan-2008 17:12   in response to: CLOSED_USER in response to: CLOSED_USER
 
  Click to reply to this thread Reply
EarlyOut,

the code is good run correct in the page but W3C css no valid because
font-family the property font-family not exist : "Freestyle Script and also
The property src not exist : url("$resPath/freescpt")

you can look the page: http://www.photoman.altervista.org/fabio-out/index.html

Code css:

@font-face{               
font-family:"Freestyle Script";
src: url("$resPath/freescpt")  
}
 
.comments{
font-family:Freestyle Script;
font-size:25px;
color:#0000ff;
}
jGromit

Posts: 8,325
Registered: 31-Jan-2006
Re: Make personal font
Posted: 17-Jan-2008 17:45   in response to: CLOSED_USER in response to: CLOSED_USER
 
  Click to reply to this thread Reply
Validators sometimes have trouble with things like that, so I don't worry about it too much.

(By the way, you need a closing ";" on the src line. But I don't think that will make any difference with the validator.)
Legend
Forum admins
Helpful Answer
Correct Answer

Point your RSS reader here for a feed of the latest messages in all forums