Skip to main content

Microsoft Silverlight

Answered Question Embedding fonts.RSS Feed

(0)

DJA01
DJA01

Member

Member

67 points

45 Posts

Embedding fonts.

I am developing a Silverlight Application that embeds fonts so as to be able to display non-supported fonts (such as Helvetica).  The code works quite well but for some unusual reason I cannot embed some Adobe fonts that I actually have licenses for.  They are OpenType fonts but whenever I specify them in my JavaScript code it uses the default font (which is Lucida Grande I do believe).  Also note that if I download free fonts off of the Internet (either OpenType or TrueType) everything works just fine.  The problem seems to be related to the Adobe fonts.

Anyone have any idea why this might be the case?  I can tried everything that I can think of but they just wont show.

Thanks

 

     // Executing the appropriate code in order to download the Fonts needed for the Silverlight Canvas.

    var spiContent = document.getElementById("mySilverlightPlugin");        // Holds a Reference to the Silverlight Plugin.
    var downloader = spiContent.createObject("downloader");
    downloader.addEventListener("Completed", onFontDownloadComplete);
    downloader.open("GET", "Fonts/Fonts.zip");
    downloader.send();


function onFontDownloadComplete(sender, eventArgs)
{

    var testBlock1;
    var testBlock2;
    var testBlock3;
 
    testBlock1 = sender.findName("textBlock1");
    testBlock2 = sender.findName("textBlock2");
    testBlock3 = sender.findName("textBlock3");

    testBlock1.setFontSource(sender);
    testBlock2.setFontSource(sender);
    testBlock3.setFontSource(sender);

    testBlock1.fontFamily = "Helvetica LT Std";
    testBlock2.fontFamily = "Helvetica LT Std";
    testBlock3.fontFamily = "Helvetica LT Std";

}

sl.ayer
sl.ayer

Participant

Participant

852 points

164 Posts

Re: Embedding fonts.

Does your license allow redistribution?

DJA01
DJA01

Member

Member

67 points

45 Posts

Re: Embedding fonts.

 Thats something that I planned on checking after I got this to work given that my Application is not "released" yet.

Would that matter in regards to whether or not Silverlight can display the fonts?  If so, how would I check?

Thanks.

DJA01
DJA01

Member

Member

67 points

45 Posts

Re: Embedding fonts.

 Anyone have any clue?

Thanks

Mark Rideout
Mark Rid...

Contributor

Contributor

2357 points

273 Posts

MicrosoftModerator
Answered Question

Re: Embedding fonts.

I believe I answered this on another post, but here goes again: Silverlight only support TrueType (TTF) and OpenType (OTF) fonts that contain TrueType outlines. There are plenty of fonts that contain postscript outlines which Silverlight does not support. In some cases you can convert open type/postscript fonts to TrueType outlines using a converter such as:
http://www.fontlab.com/font-converter/transtype/

Also, feel free to send me the font (markri@microsoft.com) and I can tell you if it is a supported font.

-mark
Silverlight Program Manager
Microsoft
This post is provided "as-is"

  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities