Skip to main content

Microsoft Silverlight

Answered Question Rename xap to zip causes font troublesRSS Feed

(0)

haagel
haagel

Member

Member

97 points

98 Posts

Rename xap to zip causes font troubles

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
IanBlack...

Contributor

Contributor

2333 points

371 Posts

Re: Rename xap to zip causes font troubles

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

Member

97 points

98 Posts

Re: Rename xap to zip causes font troubles

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
IanBlack...

Contributor

Contributor

2333 points

371 Posts

Re: Rename xap to zip causes font troubles

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

Contributor

Contributor

4677 points

595 Posts

Re: Rename xap to zip causes font troubles

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.

Dhaka, Bangladesh
LinkedIn :: SL Profile :: Blog

haagel
haagel

Member

Member

97 points

98 Posts

Re: Rename xap to zip causes font troubles

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
IanBlack...

Contributor

Contributor

2333 points

371 Posts

Re: Rename xap to zip causes font troubles

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

Member

128 points

39 Posts

Microsoft
Answered Question

Re: Rename xap to zip causes font troubles

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

Member

128 points

39 Posts

Microsoft

Re: Rename xap to zip causes font troubles

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
IanBlack...

Contributor

Contributor

2333 points

371 Posts

Re: Rename xap to zip causes font troubles

Thanks Seema!

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

Cheers

Ian Blackburn
SilverlightForBusiness.net

StefanWick
StefanWick

Contributor

Contributor

2864 points

438 Posts

Microsoft

Re: Rename xap to zip causes font troubles

Just to close the loop on the original issue: it is fixed in the Silverlight 3 code base. Check out the SL3 Beta here:

http://silverlight.net/getstarted/silverlight3/default.aspx

Thanks, Stefan Wick

Microsoft Silverlight | http://blogs.msdn.com/swick/

haagel
haagel

Member

Member

97 points

98 Posts

Re: Rename xap to zip causes font troubles

 Good to know! Thanks! :)

  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities