in Outlook Express email

 

    This tutorial assumes you have a reasonable understanding of the HTML coding behind email.  The new embedding script I use is the same one I've used right along into which I've incorporated an ingenious idea--by a Frenchman who calls himself "Sir Ille" ( from "Cyrille" I think)--and a couple of tweaks to circumvent font-embedding problems caused by the Windows Media Player versions 9+.  Using this workaround requires that only the stationery maker apply Letterman's WMP9 fix if she has that or a newer version of the player installed.  After the font(s) are embedded this way recipients will be able to see and forward the embedded fonts without further attention.
    For the new method the <object> tag is used only to embed the file--and a <bgsound> tag is used instead to carry it from email to email (I know! - so very clever of Sir Ille '-))
    I've used two forms of file address for my example below.  The "file:///" version is the one Letterman prefers, but the standard address I put in the <bgsound> tag will work just as well.  If you use Letterman's "EZ EOT" program to preview your eots, it will copy the font's address to the clipboard in the "file:///" format.

    Here's the script and its necessary companion tags to highlight and copy--I've entered the address of an eot in both the object tag and the font's <bgsound> tag (the reason why I've also put it into that tag follows):


<object classid=clsid:05589FA1-C356-11CE-BF01-00AA0055595A><param name="Filename" value="file:///C:/Fonts/EOT/MARITAS0.eot"></object>

<bgsound id=efont src="C:\fonts\eot\MARITAS0.eot" volume=-10000>

<SCRIPT language=VBScript>
document.writeln("<STYLE> @font-face { font-family: embedded; src: url("&efont.src&"); }</STYLE>")
</SCRIPT>


    I insert all of this in the <head> section of my Source code just below the closing </style> tag.  If I have a sound file in my stat I also put its <bgsound> tag in the <head> just above the <object> tag so that, in the event I add a midi using OE's "Background/Sound" dialog, only the actual sound tag will be altered--not the one containing my font (the dialog will use the first sound tag in the lineup).  So here's how the source looks now.  Notice that the new script is looking for "&efont.src&" rather than the object's "&efont.filename&" :

 

    Here's how the coding looks after a trip to the Edit tab and back.  Except for the new <bgsound> tag and a small script change, it's pretty much the same as ever ;-)

 

    After you have your chosen font entered into the <object> tag you need to save your stat to Drafts.  OE will warn you that "One or more of the pictures in this message could not be found" (because it doesn't recognize the EOT that's in the second <bgsound> tag)--but be sure to click "Yes" in answer to the warning.  After the stat is saved, close it--then reopen it from the Drafts folder and go back to the Source tab.  In the middle of the <object> tag you will find a "cid" number for your embedded font instead of its name and address:

 

    Highlight and cut the font's cid number, then paste it into the special efont <bgsound> tag (in place of the address that's there).  Be sure to retain the sound tag's "id=efont":

 

    Since it is of no use from here on (unless you change your mind about which font you want to embed ;-) --you can now highlight the whole <object> tag and delete it.

    Here's what's left.  Both the midi and the eot have cid numbers and separate id's in <bgsound> tags.  I "id" the sound so I can delay it playing until the stat is Previewed--but it also helps to define which tag is which.

 

    Now a trip to the Preview will show that an appropriate font size is needed.  I'd set this one (Marita Script - HMK) at about 17pt in the main VBScript at the bottom of the HTML.


 

    The reason the recipient doesn't need to have WMP9+ "repaired" with this method is that the <bgsound> tag is inherited from post to post whereas the <object> tag gets stripped clean in the coding.  Here are a few other--optional--little things I do when I embed a font:

  • I set the Edit pane font without a size in the <head> styles simply as:
     
        font-family: embedded;

    then set the size and styles for the embedded font in the main VBScript at the bottom of the HTML like this:

        textbox.style.fontsize="17pt"
        textbox.style.fontstyle="bold"
        textbox.style.lineheight="22px"

    or restate the font and put it all in one line like this:

        textbox.style.font="bold 17pt/22px embedded"

    Doing so allows the user to type her message with her default OE font and size (mine is 10pt Georgia) and only applies the eot and its styles in the Preview and sent email.

  • I move the "document.writeln" line from the script in the <head> to the "global" area of the regular VBScript--just above the window_onLoad sub.  This causes the default font to appear briefly in the Preview as the script is formatting the embedded one.  I find this a bit disconcerting and remedy it by making the text visibility "hidden" in the styles then making it "visible" again in the window_onLoad.  I do this routinely for the sake of script consolidation and neatness--but there's absolutely no harm in leaving the short embedding script all by itself in the <head>.

  • I initially put the efont's address into its <bgsound> tag too (even though it won't embed there) so I can see how the font looks in the Preview before I save the stat to embed it.  (The eot file can't be accessed by the script from the <object> tag because it can't share an id with the eot's <bgsound> tag--all id's must be unique).  I have so many eots it sometimes takes me a lot of Previews using different fonts to decide which one I like!

    So there you have it more or less--and after you've done it a few times it'll be very easy.  Be sure to let me know if any of this confuses you.

Liefs,

 

Feel free to save this page to your
hard drive for future reference.
January 2008