Powered by MSDN

US - English
NEW! Silverlight 5 is available Learn More

Rename xap to zip causes font troubles RSS

11 replies

Last post Mar 24, 2009 08:10 PM by haagel

(0)
  • haagel

    haagel

    Member

    97 Points

    98 Posts

    Rename xap to zip causes font troubles

    Nov 12, 2008 01:51 PM | LINK

    Since my web server doesn't support xap (it doesn't have the right MIME) I'm renaming my .xap to .zip. This works as far as the application shows up and is functional.

    BUT the fonts is screwed up! All text is enlarged which messed up my design. Why is this happening? Have anyone else had this problem?

  • IanBlackburn

    IanBlackburn

    Contributor

    2333 Points

    371 Posts

    Re: Rename xap to zip causes font troubles

    Nov 12, 2008 02:23 PM | LINK

    Are you embedding the fonts or using the built in ones?

    (If this has answered your question, "Mark as Answer" - many thanks)

    Cheers

    Ian Blackburn
    SilverlightForBusiness.net
  • haagel

    haagel

    Member

    97 Points

    98 Posts

    Re: Rename xap to zip causes font troubles

    Nov 13, 2008 07:15 AM | LINK

    I'm using the built in ones. Actually, I'm not even specifying any font information so it's the default that is being used.
  • IanBlackburn

    IanBlackburn

    Contributor

    2333 Points

    371 Posts

    Re: Rename xap to zip causes font troubles

    Nov 13, 2008 07:36 AM | LINK

    That's strange - do you have a public url you could post so I can see if the problem replicates on my machine?

    (If this has answered your question, "Mark as Answer" - many thanks)

    Cheers

    Ian Blackburn
    SilverlightForBusiness.net
  • shamrat231

    shamrat231

    Star

    10748 Points

    1283 Posts

    Re: Rename xap to zip causes font troubles

    Nov 13, 2008 07:56 AM | LINK

    Could you share the xap file[original] which extension is intact. I want to check in my pc, hosting on silverlight.live.com to see if the problem replicates itself.

    If this post was helpful then please 'Mark as Answer'

    Sharker Khaleed Mahmud
    Sr. Software Engineer
    (MCP,MCTS,MCPD[web])

    This credits that member, earns you a point and marks your thread as Resolved so we will all know you have been helped.

  • haagel

    haagel

    Member

    97 Points

    98 Posts

    Re: Rename xap to zip causes font troubles

    Nov 13, 2008 08:10 AM | LINK

    I've created a webpage that shows the problem. I've also included a link to the sourcecode on the page.

    http://webfiles.haagel.se/xaptozip/ 

    The page contains two silverlight applications. It is actually two copies of the same xap, one of which is renamed to .zip. The application only contains a TextBlock and a Button, both with some text on. If you experience the same problem as I do, the text will be notably larger in the version renamed to .zip.

  • IanBlackburn

    IanBlackburn

    Contributor

    2333 Points

    371 Posts

    Re: Rename xap to zip causes font troubles

    Nov 13, 2008 08:49 AM | LINK

    haagel

     If you experience the same problem as I do, the text will be notably larger in the version renamed to .zip.

    I am seeing exactly the same as you, but I don't have an explanation I'm afraid.  The Silverlight run-time must process zip's differently from xap's I guess.

    I did try UseLayoutRounding="True" on the elements but this did not change this situation.

    I have sent an email to Seema Ramchandani (http://blogs.msdn.com/seema/) who I think would be the person to know the answer to this.  If I get a reply I'll post it here.

     

    (If this has answered your question, "Mark as Answer" - many thanks)

    Cheers

    Ian Blackburn
    SilverlightForBusiness.net
  • seemar

    seemar

    Member

    154 Points

    42 Posts

    Microsoft

    Re: Rename xap to zip causes font troubles

    Nov 13, 2008 03:19 PM | LINK

    Hello,

    it looks like you are running into our code which triggers the 1.0 font (for backwards compat) vs. the 2.0 font (designer approved for our controls) and the fontsize based on whether the extension is a xap. The font for 2.0 applications is a special Portable UI font, which is able to handle many different languages.

    If your app is just English, you can use Verdana and maybe 10pt (I forget the size). The 1.0 font is Trebuchet. For multi-language apps, I'm waiting to hear how one can set our PUI as the font as a 2nd party.

    -Seema, http://blogs.msdn.com/seema

    Seema Ramchandani
    Silverlight
    Program Manager, Microsoft
    http://blogs.msdn.com/seema
  • seemar

    seemar

    Member

    154 Points

    42 Posts

    Microsoft

    Re: Rename xap to zip causes font troubles

    Nov 14, 2008 05:50 PM | LINK

    for multi-language apps:

    Use Verdana, the PUI will be the fallback font for any chars that Verdana does not support..

    Seema Ramchandani
    Silverlight
    Program Manager, Microsoft
    http://blogs.msdn.com/seema
  • IanBlackburn

    IanBlackburn

    Contributor

    2333 Points

    371 Posts

    Re: Rename xap to zip causes font troubles

    Nov 15, 2008 03:02 PM | LINK

    Thanks Seema!

    (If this has answered your question, "Mark as Answer" - many thanks)

    Cheers

    Ian Blackburn
    SilverlightForBusiness.net