Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Embeding Fonts in an Outlook HTML email

Status
Not open for further replies.

Ruppie

Programmer
Sep 14, 2003
8
GB
Prob. Anyone know how to reference an embedded font without scripting ? (as most people have scripting disabled to avoid harmful scripts being run)

Background. I have an editable font and have used Microsofts WEFT utility to create the .eot file (as detailed in the great article Using stationery and specifying a full path URL to the .eot file the html email works fine, but as the recipient wouldn't have this file you have to embed it and it gets a unique id which in turn is referenced by script and thus don't work. Phew.

Code examples:-

*Working Code (scripting is needed for the statement src: url("&Fount1&");")

<body>
<p><img id="efont1"
src="file:///C:/Working/speciale.eot" style="display: none"></p>


<script language="VBScript">
'
' VBScript Example to write css STYLE
'
Dim Fount1, texxt1
Dim lines(11)
'
texxt1="text/css"
Fount1=efont1.src 'This is the id name in the IMG spec
'
lines(1)="<head/>"
lines(2)="<STYLE TYPE="&texxt1&">"
lines(3)="<!--"
lines(4)=" @font-face {"
lines(5)=" font-family: Special Font;"
lines(6)=" font-style: normal;"
lines(7)=" font-weight: 700;" 'Changing this value is optional
lines(8)=" src: url("&Fount1&");"
lines(9)=" }"
lines(10)="-->"
lines(11)="</STYLE></head>"
'
' Now write the STYLE
'
for i=1 to 11
Document.Writeln lines(i)
next
'
</script>


<p><font face="Special Font">This is text in Special Font</font></p>

</body>


*Not working code (cid refences embedded font image)

<body>

<p><img id="efont1"
src="cid:453142012@02032004-2657" style="display: none"></p>

<STYLE>
@font-face { font-family: Special font;font-style: normal;font-weight: 700;src: url("efont1");}
</STYLE>

<p Style="font-family: Special Font">This is text in Special Font</p>
</body>


Any clues or pointers much appreciated.
 
Most people have servers that bounce or dump html emails. Why not save yourself the headache, SEND a TEXT EMAIL with a link to your HTML version . Emails should never be more than 2 kb - 4 kb in size; HTML emails will double - triple the size of an email.
 
Yeah your right, but if they ain't got internet access they can't get the full email.
Think we're going to compromise, still in HTML format but not embed the font(no not big file), but provide an absolute URL to the font so if they have internet access they read the email in the corporate font, otherwise in there own default font.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top