How best to Force Unique font - Noob 101, @font-face not behaving |
How best to Force Unique font - Noob 101, @font-face not behaving |
BalancedLineOut |
Feb 15 2012, 02:39 PM
Post
#1
|
Newbie Group: Members Posts: 11 Joined: 15-February 12 Member No.: 16,487 |
I remember a few years ago building a ebsite and specifying a unique font using the M/S WEFT tool. I want to force browsers to use a specific font again, and came across "@font-face". I used the online utility font-squirrel, and even after doing that, I can't get the unique font to load in my web page. The sample they provide works fine, so it has to be something I'm doing... or not doing.
I know this sounds really nasty, but I've not worked with CSS before this past weekend, although I can immediately see it's advantages, and I've created so very nice pages with it. I seem to be missing the boat on this font thing, something that should be relatively simple. I guess I'm confiused as to where the specific pieces of code go... in the index.html or the sytle.css file. Non of the tutorials are clear on that, and assume more knowledge on the subject than I have. I've even gone back to the basics - since the site I was trying to apply this to was kind of busy with code - and started working fresh on new files. Still can't get the font to work....unless I load it as a system font,. Thks for the read, and putting up with another noob. S~ |
Frederiek |
Feb 16 2012, 02:53 AM
Post
#2
|
Programming Fanatic Group: Members Posts: 5,146 Joined: 23-August 06 From: Europe Member No.: 9 |
You get the @font-face syntax from Font Squirrel inside stylesheet.css. Then have a look in the demo.html page and see how the font-family is called for BODY in an embedded style at the top of the page.
Since your font is DistortiaRegular, that's what you should use (font-family: DistortiaRegular) in your .style1 declaration, instead of "font-family: distorti-webfont". As for DW, I have an old version too and it didn't even want to show a regular font (Verdana), when I had to make some pages with it. What I did was declare the font for all selectors embedded in the page itself. Only then it worked. Mind you, I'm used to handcode HTML and CSS. I had never used DW before. |
BalancedLineOut |
Feb 16 2012, 06:36 AM
Post
#3
|
Newbie Group: Members Posts: 11 Joined: 15-February 12 Member No.: 16,487 |
@Frederiek
Well in the end I had to use the source code for the sample page provided by font-squirrel. Something in the code that was on the face of the document didn't add up, even after I figured out D/W was failing to show the font. All's well that ends well, I suppose. @pandy Good point lesson learned. In my defense, I had previewed pages earlier in the session... I guess there were syntax errors still. After using D/W for as long as I have, it never occurred to me that it would fail to display a typeface inline. Actually, going back to the original page I had created using WEFT, D/W did display that font inline. Perhaps the difference is that I installed it as a system font to achieve the effect, and used WEFT to push the font out later. In this case, I already was aware of the font issue so I didn't install it as a system font. That' probably why D/W didn't display it. Complicates the validating procedure a bit in that I have to look at the files from another system that doesn't have the font in question on it. And my son thought HTML was easy. S~ |
pandy |
Feb 16 2012, 06:58 AM
Post
#4
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,731 Joined: 9-August 06 Member No.: 6 |
It is. But CSS is a *beep*.
|
Lo-Fi Version | Time is now: 26th April 2024 - 08:51 AM |