Academic Tutorials



English | French | Portugese | German | Italian
Home Advertise Payments Recommended Websites Interview Questions FAQs
News Source Codes E-Books Downloads Jobs Web Hosting
Chats

CSS 2.0
CSS 2.0 Introduction
CSS 2.0 Attaching Style
CSS 2.0 Applying Style
CSS 2.0 Key Concepts
CSS 2.0 Color Contents
CSS 2.0 Fonts Contents
CSS 2.0 Text
CSS 2.0 Lists
CSS 2.0 the box model
CSS 2.0 Advanced concepts
CSS 2.0 Positioning
CSS 2.0 Boxes
CSS 2.0 Generated content
CSS 2.0 Dynamic effects
CSS 2.0 Tables
CSS 2.0 Paged media
CSS 2.0 Font Face
CSS 2.0 Aural Style Sheets
CSS 2.0 Language styles

HTML Tutorials
HTML Tutorial
XHTML Tutorial
CSS Tutorial
TCP/IP Tutorial
CSS 1.0
CSS 2.0
HLML
XML Tutorials
XML Tutorial
XSL Tutorial
XSLT Tutorial
DTD Tutorial
Schema Tutorial
XForms Tutorial
XSL-FO Tutorial
XML DOM Tutorial
XLink Tutorial
XQuery Tutorial
XPath Tutorial
XPointer Tutorial
RDF Tutorial
SOAP Tutorial
WSDL Tutorial
RSS Tutorial
WAP Tutorial
Web Services Tutorial
Browser Scripting
JavaScript Tutorial
VBScript Tutorial
DHTML Tutorial
HTML DOM Tutorial
WMLScript Tutorial
E4X Tutorial
Server Scripting
ASP Tutorial
PERL Tutorial
SQL Tutorial
ADO Tutorial
CVS
Python
Apple Script
PL/SQL Tutorial
SQL Server
PHP
.NET (dotnet)
Microsoft.Net
ASP.Net
.Net Mobile
C# : C Sharp
ADO.NET
VB.NET
VC++
Multimedia
SVG Tutorial
Flash Tutorial
Media Tutorial
SMIL Tutorial
Photoshop Tutorial
Gimp Tutorial
Matlab
Gnuplot Programming
GIF Animation Tutorial
Scientific Visualization Tutorial
Graphics
Web Building
Web Browsers
Web Hosting
W3C Tutorial
Web Building
Web Quality
Web Semantic
Web Careers
Weblogic Tutorial
SEO
Web Site Hosting
Domain Name
Java Tutorials
Java Tutorial
JSP Tutorial
Servlets Tutorial
Struts Tutorial
EJB Tutorial
JMS Tutorial
JMX Tutorial
Eclipse
J2ME
JBOSS
Programming Langauges
C Tutorial
C++ Tutorial
Visual Basic Tutorial
Data Structures Using C
Cobol
Assembly Language
Mainframe
Forth Programming
Lisp Programming
Pascal
Delphi
Fortran
OOPs
Data Warehousing
CGI Programming
Emacs Tutorial
Gnome
ILU
Soft Skills
Communication Skills
Time Management
Project Management
Team Work
Leadership Skills
Corporate Communication
Negotiation Skills
Database Tutorials
Oracle
MySQL
Operating System
BSD
Symbian
Unix
Internet
IP-Masquerading
IPC
MIDI
Software Testing
Testing
Firewalls
SAP Module
ERP
ABAP
Business Warehousing
SAP Basis
Material Management
Sales & Distribution
Human Resource
Netweaver
Customer Relationship Management
Production and Planning
Networking Programming
Corba Tutorial
Networking Tutorial
Microsoft Office
Microsoft Word
Microsoft Outlook
Microsoft PowerPoint
Microsoft Publisher
Microsoft Excel
Microsoft Front Page
Microsoft InfoPath
Microsoft Access
Accounting
Financial Accounting
Managerial Accounting
Network Sites


CSS 2.0 Properties - @font-face


Previoushome Next






CSS2 Properties - @font-face

A D V E R T I S E M E N T



@font-face

The @font-face at-rule is used for a variety of purposes, but essentially it is used to specify the correct behavior when a font is not available locally.

In general, the @font-face at-rule is used for this purpose. This follows a form similar to this @font-face {property: value; property: value}.

There may be any number of @font-face rules in a stylesheet.

Font selection properties

font-family

This specifies the name of a font that you are describing. For example, @font-face {font-family: Arial}. Multiple font families can be specified; e.g., @font-face {font-family: sans-serif, Arial}. It takes the same values as

font-style, font-size, font-weight, font-stretch, font-variant

This specifies the type of font that is being described.

They take the same values as their equivalent normal properties, except they can take a comma-separated list.

For font-style, font-size, font-stretch and font-weight, however, the 'all' value is also valid, which indicates that all values are matched.

However, values that relate to another value are not valid (e.g., smaller and bolder), and neither are the font size keywords 'large', 'small', etc.

E.g., font-weight: 100, 300, 500, 600, 700, 800, 900.

The initial value for font-size, font-weight and font-style is all. For font-variant and font-stretch it is normal.


Font retrieval properties

If it is important that a specific font is used in viewing your document, you should use the properties that specify its location and characteristics.

src

The src property specifies the location of a font: It follows this basic syntax: src: url(address1). Thus to be specify that you can find the 'foo' font at www.foo.com, you would use @font-face {font-family: foo; src: url(www.foo.com)}.

If you wish, you can specify the format of the font. E.g., @font-face {font-family: foo; src: url(http://www.foo.com) format("footype")}. To be specify several uris for browsers that support different font types, you separate them with commas. E.g., @font-face {font-family: foo; src: url(http://www.foo.com) format("footype"), src(http://www.foo2.com) format("foo4")}.

Note that the format must be in quotes.

Finally, you can specify the name of a local font to match. E.g., to specify that when an element is specified as being in Times, Times New Roman should be used, you would type:

@font-face {font-family: Times;
src: local("Times New Roman")}

Note again that the font name must be in quotes, even if it doesn't include whitespace.

Here's another example, which specifies the location of italic Foo.

@font-face {font-family: Foo;
src: url(http://www.foo.com);
font-style: italic}

Since font-size is initially all, the font will be used at all sizes; but will not be used for small-caps or stretched text, since font-variant and font-stretch are initally set to normal.

unicode-range property

The unicode-range is used to ensure that fruitless downloads are not made. It specifies the characters that are matched by glyphs in the font.

The syntax of the unicode-range is the literal string 'U+' followed by a hexadecimal number.

Wildcard characters ? (indicates any value for that digit) and * (indicates any number of digits with any value) are permissible. Thus U+12?? matches 12AC or 1209, etc.

To specify a range, a hyphen is used - e.g., U+1200-1210. The first number is the start of the range, the second the end of the range.

To specify several unicode ranges, you separate them with commas - e.g., U+12??, U+1400-1500 matches 1200-12FF and 1400-1500.

A typical declaration is unicode-range: U+0-1F, U+10CF*.

Hexadecimal numbers refer to codes in ISO 10646.

The initial value for unicode-range is U+0-7FFFFFFF.


Descriptor needed for font synthesis, matching and alignment

units-per-em

In order that numeric descriptors have meaning, it is necessary to specify the number of units that the em square is divided into. Typical values include 2048 (Truetype) and 250 (Intellifont).

Once declared, a unit that requires it will divide by this value to get the true measurement. E.g., stemh: 200 would divided by units-per-em to get the true height.


Font matching descriptors

If you want intelligent font matching or font size adjustment, you need to specify technical details about the font. Here are the properties that are used:

panose-1

This can be followed by exactly 10 space-separated decimal integers. This indicates the font's panose number for font matching. It is initially set to panose-1: 0 0 0 0 0 0 0 0 0 0. This initial value matches all fonts. The panose-1 descriptor allows you to ensure that a font similar to the one you want is used. Its use is highly recommended, since it generally results in similar fonts. However, not all fonts contain panose information.

stemv and stemh

This indicates the font's vertical (stemv) and horizontal (stemh) stem width as a number. If declared, units-per-em must be declared. This will allow intelligent font size adjustment.

Their initial value is undefined.

slope

This specifies the vertical slope angle, and is intially set to 0.

cap-height

The cap-height descriptor specifies the height of uppercase glyphs. Its initial value is undefined. If declared, units-per-em must be declared.

x-height

The x-height (essential if font-size-adjust is used) descriptor specifies the x-height of the font. If declared, units-per-em must be declared. Its initial value is undefined.

ascent

The ascent descriptor specifies the maximum unaccented height of the font. If declared, units-per-em must be declared. Its initial value is undefined.

descent

The descent descriptor specifies the maximum unaccent depth of the font. If declared, units-per-em must be declared. Its initial value is undefined.


Font synthesis descriptors

Since fonts can be very large, when you specify a remote font, it is preferable to use a synthesized font. Crucial to this are the widths and bbox descriptors. These descriptors are required to avoid reflow.

Further to this, the font matching descriptors may be used to give a better appearance of the true font.

widths

Here you specify a unicode range followed by a number for the widths of the glyph. E.g., widths: U+1* 1490. Or widths: U+1-3 1200 1456 1357, U+1? 1167.

If not enough glyph widths are provided for the list, the last in the list is assumed to cover all omitted values. E.g., widths: U+1200-120A 1700 1701 1702 would give the glyph for the character corresponding to hex 1200 a width of 1700, that with hex 1201 1701, and 1202-120A a width of 1702.

Note that it is only of use when a given character only has one matching glyph in the font.

If declared, units-per-em must be declared.

Widths' initial value is undefined.

bbox

This is used to specify the maximal bounding box of the font. It is exactly four comma-delimited numbers specifying lower left x, lower left y, upper right x, upper right y in that order of the font.

Bbox's initial value is undefined.

definition-src

This provides the url of a separate font definition resource so that if multiple stylesheets use the same definition, download time is reduced. E.g., definition-src: url(url.url).


Font alignment descriptors

In order that different scripts can be aligned with each other, these descriptors are used.

baseline

This is specified as a number, initially 0 that describes the lower baseline (used for alignment in Latin, Greek and Cyrillic fonts) of a font. It is the position in the em square, and as such if declared, so must units-per-em.

centerline

This defines the central baseline (used for alignment in ideographic scripts) of the font, as a number. It is the position in the em square, and as such if declared, so must units-per-em.

Its initial value is undefined, but approximations to it may be used if undeclared.

mathline

This defines the mathematical baseline (used for alignment in mathematical fonts) of the font. It is the position in the em square, and as such if declared, so must units-per-em.

Its initial value is undefined, but approximations to it may be used if undeclared.

topline

This defines the top baseline of a font (used for alignment in Sanscrit-based fonts). It is the position in the em square, and as such if declared, so must units-per-em.

Its initial value is undefined, but approximations to it may be used if undeclared.



Be the first one to comment on this page.




  CSS 2.0 eBooks
More Links » »
 
 CSS 2.0 FAQs
More Links » »
 
 CSS 2.0 Interview Questions
More Links » »
 
 CSS 2.0 Articles

No CSS 2.0 Articles could be found as of now.

 
 CSS 2.0 News

No News on CSS 2.0 could be found as of now.

 
 CSS 2.0 Jobs

No CSS 2.0 Articles could be found as of now.


Share And Enjoy:These icons link to social bookmarking sites where readers can share and discover new web pages.
  • blinkbits
  • BlinkList
  • blogmarks
  • co.mments
  • connotea
  • del.icio.us
  • De.lirio.us
  • digg
  • Fark
  • feedmelinks
  • Furl
  • LinkaGoGo
  • Ma.gnolia
  • NewsVine
  • Netvouz
  • RawSugar
  • Reddit
  • scuttle
  • Shadows
  • Simpy
  • Smarking
  • Spurl
  • TailRank
  • Wists
  • YahooMyWeb

Previoushome Next

Keywords: CSS2 Properties - @font-face, CSS2, css2, CSS2 tutorial, CSS2 tutorial pdf, history of CSS2, Custamizing Style Sheet, learn CSS2

HTML Quizzes
HTML Quiz
XHTML Quiz
CSS Quiz
TCP/IP Quiz
CSS 1.0 Quiz
CSS 2.0 Quiz
HLML Quiz
XML Quizzes
XML Quiz
XSL Quiz
XSLT Quiz
DTD Quiz
Schema Quiz
XForms Quiz
XSL-FO Quiz
XML DOM Quiz
XLink Quiz
XQuery Quiz
XPath Quiz
XPointer Quiz
RDF Quiz
SOAP Quiz
WSDL Quiz
RSS Quiz
WAP Quiz
Web Services Quiz
Browser Scripting Quizzes
JavaScript Quiz
VBScript Quiz
DHTML Quiz
HTML DOM Quiz
WMLScript Quiz
E4X Quiz
Server Scripting Quizzes
ASP Quiz
PERL Quiz
SQL Quiz
ADO Quiz
CVS Quiz
Python Quiz
Apple Script Quiz
PL/SQL Quiz
SQL Server Quiz
PHP Quiz
.NET (dotnet) Quizzes
Microsoft.Net Quiz
ASP.Net Quiz
.Net Mobile Quiz
C# : C Sharp Quiz
ADO.NET Quiz
VB.NET Quiz
VC++ Quiz
Multimedia Quizzes
SVG Quiz
Flash Quiz
Media Quiz
SMIL Quiz
Photoshop Quiz
Gimp Quiz
Matlab Quiz
Gnuplot Programming Quiz
GIF Animation Quiz
Scientific Visualization Quiz
Graphics Quiz
Web Building Quizzes
Web Browsers Quiz
Web Hosting Quiz
W3C Quiz
Web Building Quiz
Web Quality Quiz
Web Semantic Quiz
Web Careers Quiz
Weblogic Quiz
SEO Quiz
Web Site Hosting Quiz
Domain Name Quiz
Java Quizzes
Java Quiz
JSP Quiz
Servlets Quiz
Struts Quiz
EJB Quiz
JMS Quiz
JMX Quiz
Eclipse Quiz
J2ME Quiz
JBOSS Quiz
Programming Langauges Quizzes
C Quiz
C++ Quiz
Visual Basic Quiz
Data Structures Using C Quiz
Cobol Quiz
Assembly Language Quiz
Mainframe Quiz
Forth Programming Quiz
Lisp Programming Quiz
Pascal Quiz
Delphi Quiz
Fortran Quiz
OOPs Quiz
Data Warehousing Quiz
CGI Programming Quiz
Emacs Quiz
Gnome Quiz
ILU Quiz
Soft Skills Quizzes
Communication Skills Quiz
Time Management Quiz
Project Management Quiz
Team Work Quiz
Leadership Skills Quiz
Corporate Communication Quiz
Negotiation Skills Quiz
Database Quizzes
Oracle Quiz
MySQL Quiz
Operating System Quizzes
BSD Quiz
Symbian Quiz
Unix Quiz
Internet Quiz
IP-Masquerading Quiz
IPC Quiz
MIDI Quiz
Software Testing Quizzes
Testing Quiz
Firewalls Quiz
SAP Module Quizzes
ERP Quiz
ABAP Quiz
Business Warehousing Quiz
SAP Basis Quiz
Material Management Quiz
Sales & Distribution Quiz
Human Resource Quiz
Netweaver Quiz
Customer Relationship Management Quiz
Production and Planning Quiz
Networking Programming Quizzes
Corba Quiz
Networking Quiz
Microsoft Office Quizzes
Microsoft Word Quiz
Microsoft Outlook Quiz
Microsoft PowerPoint Quiz
Microsoft Publisher Quiz
Microsoft Excel Quiz
Microsoft Front Page Quiz
Microsoft InfoPath Quiz
Microsoft Access Quiz
Accounting Quizzes
Financial Accounting Quiz
Managerial Accounting Quiz
Testimonials | Contact Us | Link to Us | Site Map
Copyright 2008. Academic Tutorials.com. All rights reserved Privacy Policies | About Us
Our Portals : Academic Tutorials | Best eBooksworld | Beyond Stats | City Details | Interview Questions | Discussions World | Excellent Mobiles | Free Bangalore | Give Me The Code | Gog Logo | Indian Free Ads | Jobs Assist | New Interview Questions | One Stop FAQs | One Stop GATE | One Stop GRE | One Stop IAS | One Stop MBA | One Stop SAP | One Stop Testing | Webhosting in India | Dedicated Server in India | Sirf Dosti | Source Codes World | Tasty Food | Tech Archive | Testing Interview Questions | Tests World | The Galz | Top Masala | Vyom | Vyom eBooks | Vyom International | Vyom Links | Vyoms | Vyom World
Copyright 2003-2017 Vyom Technosoft Pvt. Ltd., All Rights Reserved.