|
FontsHere are my notes on Fonts. | Topics this page: |
|
HTML5 and CSS3 have breathed new life to font handling, and is enabling an explosion in variety of fonts on the internet.
New CSS3 pseudo-classes make it easier to specify a font unique to a specific paragraph:
p:nth-child(2) { font-family: 'OrbitronBold'; }
TOOL: Font Squirrel Font Generator creates, from a supplied font, all the different file formats needed to satisfy various browsers:
Font Squirrel also generates a css file to reference the files:
@font-face { font-family: 'OrbitronBold'; src: url('orbitron-bold-webfont.eot'); src: url('orbitron-bold-webfont.eot?iefix' format('eot'), url('orbitron-bold-webfont.off' format('otf'), url('orbitron-bold-webfont.woff' format('woff'), url('orbitron-bold-webfont.ttf' format('truetype'), url('orbitron-bold-webfont.svg#webfontWKGjCdAU' format('svg'), font-weight: normal; font-style: normal; }
WARNING: The .eot?iefix must be the first line because Microsoft browsers ignores what follows. The question mark forces Microsoft browsers to throw away the rest of the src tag.
BLAH: Extended drama: two src statements are needed for Microsoft browsers. Some versions pick up the first statement, but some versions are more stubborn and need to be told a second time. ;)
This hack was identified by Paul Irish at ARTICLE: bulletproof-font-face-implementation-syntax.
TOOL: League of Movable Fonts provides great fonts FREE for download.
TIP: Font files in the src tag can be hosted anywhere on the web.
TOOL: Google web fonts hosts free fonts (no on their CDN).
<link href='http://fonts.googleapis.com/css?family=Anton' rel='stylesheet' type='text/css'>
TOOL: Fontdeck, for $11,90 per year, hosts fonts on their server.
Character Sets - Some History
U.S. versions of Microsoft Windows up to and including Windows 95 and Windows NT 4 used a character set defined by the ANSI (the American National Standards Institute). The ANSI set had 217 characters out of 256 possible combinations from 8 bits — a single byte). It is also known as "Windows-1252". The ANSI character set consists of a "Basic Latin" range with values 0-127, and a "Latin-1 Supplement" for characters 160-255. Apple's proprietary 226-character MacRoman character set uses 95 characters from values 32-126 of the ANSI character set and adds more. ANSI is a superset of the ISO-8859-1 character set. To the basic ANSI set Microsoft later added the euro currency symbol and introduced a Pan-European font with its proprietary 16-bit WGL4 (Windows Glyph List 4) character set in different 652 character code pages (with page 1252 being the English ANSI character set). OEMs (Orginal Equipment Manufacturers) such as IBM made provision for more special characters and languages by replacing the entire code page (identified as 437 in the United States) with a custom code page used by a specific locale. The large number of characters in Asian languages led to the development of multibyte character sets, in particular the double-byte character set (DBCS). DBCS character handling requires detailed changes in the character-processing algorithms throughout an application's source code. To make localizing applications easier, an international body defined the Unicode standard using 16 bits to define up to 65,536 characters. Unicode-enabled functions are often referred to as "wide-character" functions. Using pairs of unicode characters (called "surrogates"), Unicode can support over one million characters. Version 2.0 of Unicode supports over one million characters by surrogates — pairs of 16-bit unicode characters. The first (high) surrogate is a 16-bit code value in the range U+D800 to U+DBFF. The second (low) surrogate is a 16-bit code value in the range U+DC00 to U+DFFF. Microsoft began supporting surrogates with Windows 2000 (not 95/98/Me) with cmap 12 OpenType font format and surrogate-enabled IMEs. Since Windows disables surrogate support by default, two registry values must be set to enable surrogate support: [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\LanguagePack] SURROGATE=(REG_DWORD)0x00000002 [HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\International\Scripts\42] IEFixedFontName=[Surrogate Font Face Name] IEPropFontName=[Surrogate Font Face Name] | Related Topics: |
Browser Fonts
Download fonts only from known reputable sources, because errors in fonts is a known way to crash the ATMFD.DLL CFF (Compact Font Format) font driver or even take over a MSWindows system, simply by clicking on a font icon. Microsoft created OpenType fonts after it balked at license fees for Adobe's superior Type 1 Postscript fonts.
The 'TITUS Cyberbit Basic' font is a derivative of the Bitstream Cyberbit font developed by TITUS for compliance with Unicode 4.0 (tu30560.zip)
|
Browser CheckTo see if your browser dispays international languages:
Retrieving font name from within TrueType or OpenType files (.ttf)
|
Microsoft Font Files
Browsers display little boxes instead of characters when you don't have your browser set to use international fonts. Question marks take the place of characters displayed with incorrect encoding. MS Font Properties Extension v2.1 The "OS/2" table of a TrueType 1.0 font file contains information about its typeface weight, superscripts, strikeouts, ascender/descender values, PANOSE classification, licensing info, and more.
Installing FontsIn Windows, there are two ways to install a font:
To make Microsoft Developer Studio recognize a custom font: |
Custom Fonts
This page contains JavaScript code from Microsoft's Typography site to detect what browser is being used so that it can replace text instead of the logo defined as glyph M within a special font face mslogo.eot: Microsoft This makes a logo automatically expand and contract with its surrounding text. PostScript type 3 format is human-readable Postscript program code for Postscript printers. Metafont, Knuth's font format used in mathematical and linguistic communities, is also a program. |
Java Fonts
Java 2 fonts have a family name, a logical font name, and a face name. Jave 2 JRE supplied fonts: Dialog (the default), DialogInput, Sans Serif, Serif, Monospaced, and Symbol
|
Java Font Methods Java provides the Font class to encapsulate fonts. This wrapper allows interaction with fonts as if they were any other class.
|
Java Font HandlingFor an array of strings listing what fonts are available on the client system, use a characteristic of the GraphicsEnvironment class: getAvailableFontFamilyNames,
To create an instance of the Font class:
new Font ( String fontName, int fontStyle, int fontPointSize);
|
| Your first name: Your family name: Your location (city, country): Your Email address: |
Top of Page
Thank you! |