Differences between revisions 5 and 6
Revision 5 as of 2009-11-14 12:14:42
Size: 3946
Editor: KaiJaeger
Comment:
Revision 6 as of 2009-12-28 11:54:47
Size: 4976
Editor: KaiJaeger
Comment:
Deletions are marked like this. Additions are marked like this.
Line 7: Line 7:
'''''Font embedding''''' simply means that when a website is in need for a specific font to display a particular, then this font is downloaded and temporarily installed. '''''Font embedding''''' simply means that when a web site is in need for a specific font to display a particular piece of text then this font is downloaded and installed temporarily.
Line 11: Line 11:
For APLers it's a chance to display APL code correctly on any machine even if that machine does not have an appropriate APL Unicode font installed.

== What it is not ==

This article assumes that you have sufficient skills in CSS.
Line 12: Line 18:
Font embedding was introduced by Microsoft with Internet Explorer 4 a long long time ago. This was never adapted by other Browsers, and there was a good reason for that: IE only accepts so-called EOT-fonts. Now this format, although it has clear merits, was owned by Microsoft, and Microsoft never even tried to make it a standard. For that reason others stood away from this format.
Line 14: Line 19:
In 2009, two things changed: Firstly, Almost all others (with the notable exception of Chrome) browsers started to implement font embedding, although in a very different way. Secondly, Microsoft made the EOT-format public and at the same time started to make it a W3C-accepted standard. Font embedding was introduced by Microsoft with Internet Explorer 4 a long long time ago. This was never adapted by other browsers, and there was a reason for that: IE only accepts so-called EOT-fonts. Now this format, although it has its merits, was owned by Microsoft, and Microsoft never even tried to make it a standard. For that reason other browser vendors stood away from this format.
Line 16: Line 21:
That's good news, although for the time being it means that one has to provide different CSS rules for the IE and all the other browser. In 2009, two things changed: Firstly, almost all other browsers (with the notable exception of Chrome) started to implement font embedding, although in a very different way. Secondly, Microsoft made the EOT-format public and at the same time started to make it a W3C-accepted standard.

That's good news, although for the time being it means that one has to provide different CSS rules for the IE and all the other browsers.
Line 20: Line 27:
EOT addresses two important issues: EOT, which stands for "Embedded Open Type", addresses two important issues:
Line 24: Line 31:
 * It can be bound to a particular URL. In other words, only when the font is downloaded from a URL listed in the EOT files will IE use it. These allows to address licensing issues.  * It can be bound to a particular URL. In other words, only when the font is downloaded from a URL contained in the EOT file itself will IE make use of it. These allows to address licensing issues.
Line 26: Line 33:
The way Microsoft has implemented it is unfortunately different from other browser: You cannot specify "Local" or "Format". If you are interested in details, google for it. The way Microsoft has implemented it in terms of CSS rules is unfortunately different from all the other browsers: You cannot specify "Local" or "Format". If you are interested in details, this is the best source I managed to find: [[http://randsco.com/index.php/2009/07/04/p680|Embedding fonts: cross-browser problems]]
Line 30: Line 37:
TTF fonts are used by the rest of the world. Unfortunately there is no way to address licensing issues. Strictly speaking one can use only free fonts with this technique. Good news is that everybody is allowed to distribute "APL385 Unicode" freely. TTFs (True Type Fonts) are used by the rest of the world for embedding fonts. Unfortunately there is no way to address licensing issues. This is bad news because it means that strictly speaking one can use only free TTFs for embedding purposes. Good news is that thanks to Adrian Smith, the owner and originator of "APL385 Unicode", everybody is allowed to distribute the "APL385 Unicode" TTF freely.
Line 34: Line 41:
To make "APL385 Unicode" available for font embedding in IE, we need an EOT file. Now there is a tool available from Microsoft called WEFT that theoretically allows us to do this, but unfortunately IE won't use the resulting EOT file. The reasons are unknown. In order to use the "APL385 Unicode" fonts for font embedding in IE we need to convert this font into an EOT file. Now if you are interested in how to do this, here are <<SeeSaw(section="EOT", toshow="<<the details>>.", tohide="<<Hide>> (hide details)", bg="#FEE1A5", speed="Slow")>>
{{{{#!wiki seesaw/EOT/EOT-bg/hide
Line 36: Line 44:
But there is a tools available that '''can''' create an EOT file that is used by IE8. Originally it was a UNIX/LINUX project: There is a tool available from Microsoft called WEFT that theoretically allows us to do this, but unfortunately IE won't use the resulting EOT file. The reasons are unknown.

However, there is a tool available that '''can''' create an EOT file that is used by IE8. Originally it was a UNIX/LINUX project:
Line 39: Line 49:

but you can

  
[[attachment:ttf2eot.zip|download the Windows version.]]
Line 52: Line 57:
}}}}
Line 53: Line 59:
Here is CSS code that defines a font "APLFont" from an embedded font. Note that IE '''must''' come first, and that the IE part must not contain neither "local" nor "format" - IE doesn't understand them. Note that the link http://misc.aplteam.com/apl385U.eot is real, but of course you should not use it. But you don't have to: Instead you can download a zipped version of the font from this page, see the "Downloads" section at the very end of the page.

Here is CSS code that defines a font "APLFont" from an embedded font. Note that IE '''must''' come first, and that the IE part '''must not''' contain "local" and "format" - IE doesn't understand them and as a result fails to process the whole CSS rule. Note that the link http://misc.aplteam.com/apl385.eot is real, but of course you should not use it.
Line 75: Line 83:
Note that this lets the browser try to use a local "APL385 Unicode" font first. If there is no such font installed on the local machine, it tries to find "APLX Upright". Only when this fails, too, it makes use of the embedded font. Note that this lets the browser try to use a local "APL385 Unicode" font first. If there is no such font installed on the local machine, it tries to find "APLX Upright". Only when this fails, too, it tries to download the embedded font.
Line 77: Line 85:
The eot file is [[attachment:apl385U.eot|available for download.]] == Downloads ==

 * [[attachment:apl385U.eot]] (The "APL385 Unicode" font as EOT file; needed for IE)

UnderstandingFontEmbedding

What it is

Font embedding simply means that when a web site is in need for a specific font to display a particular piece of text then this font is downloaded and installed temporarily.

From a designers point of view this is really nice, but there are important issues regarding licensing.

For APLers it's a chance to display APL code correctly on any machine even if that machine does not have an appropriate APL Unicode font installed.

What it is not

This article assumes that you have sufficient skills in CSS.

History

Font embedding was introduced by Microsoft with Internet Explorer 4 a long long time ago. This was never adapted by other browsers, and there was a reason for that: IE only accepts so-called EOT-fonts. Now this format, although it has its merits, was owned by Microsoft, and Microsoft never even tried to make it a standard. For that reason other browser vendors stood away from this format.

In 2009, two things changed: Firstly, almost all other browsers (with the notable exception of Chrome) started to implement font embedding, although in a very different way. Secondly, Microsoft made the EOT-format public and at the same time started to make it a W3C-accepted standard.

That's good news, although for the time being it means that one has to provide different CSS rules for the IE and all the other browsers.

IE and EOT

EOT, which stands for "Embedded Open Type", addresses two important issues:

  • It can be reduced to contain not all but only those characters of a particular font which got actually used on a particular web site.

  • It can be bound to a particular URL. In other words, only when the font is downloaded from a URL contained in the EOT file itself will IE make use of it. These allows to address licensing issues.

The way Microsoft has implemented it in terms of CSS rules is unfortunately different from all the other browsers: You cannot specify "Local" or "Format". If you are interested in details, this is the best source I managed to find: Embedding fonts: cross-browser problems

TTF fonts

TTFs (True Type Fonts) are used by the rest of the world for embedding fonts. Unfortunately there is no way to address licensing issues. This is bad news because it means that strictly speaking one can use only free TTFs for embedding purposes. Good news is that thanks to Adrian Smith, the owner and originator of "APL385 Unicode", everybody is allowed to distribute the "APL385 Unicode" TTF freely.

Converting a TTF font into EOT

In order to use the "APL385 Unicode" fonts for font embedding in IE we need to convert this font into an EOT file. Now if you are interested in how to do this, here are the details .

There is a tool available from Microsoft called WEFT that theoretically allows us to do this, but unfortunately IE won't use the resulting EOT file. The reasons are unknown.

However, there is a tool available that can create an EOT file that is used by IE8. Originally it was a UNIX/LINUX project:

http://code.google.com/p/ttf2eot/

This tool has a disadvantage: it does not allow us to bind the EOT-file to a particular URL. In our case, however, it doesn't matter.

The syntax to convert any font is easy; given you are in a directory where the exe as well as the font to be converted is located:

  ttf2eot.exe OLD-FONT.ttf NEW-FONT.eot

But you don't have to: Instead you can download a zipped version of the font from this page, see the "Downloads" section at the very end of the page.

Here is CSS code that defines a font "APLFont" from an embedded font. Note that IE must come first, and that the IE part must not contain "local" and "format" - IE doesn't understand them and as a result fails to process the whole CSS rule. Note that the link http://misc.aplteam.com/apl385.eot is real, but of course you should not use it.

/* IE first */
@font-face {
        font-family: 'APLFont';
        src:    url("http://misc.aplteam.com/apl385U.eot");
}

@font-face {
        font-family: 'APLFont';
        src:    url("http://misc.aplteam.com/apl385.ttf");
}

Now "APLFont" can be used in the same way as any other font-family in CSS. An example:

pre{
font-family:"APL385 Unicode","APLX Upright",APLFont,monospace;}

Note that this lets the browser try to use a local "APL385 Unicode" font first. If there is no such font installed on the local machine, it tries to find "APLX Upright". Only when this fails, too, it tries to download the embedded font.

Downloads

  • apl385U.eot (The "APL385 Unicode" font as EOT file; needed for IE)

Author: KaiJaeger


CategoryUnicode

UnderstandingFontEmbedding (last edited 2017-11-21 10:08:49 by KaiJaeger)