Thursday, December 27, 2007

Microsoft's New Year Resolution for Silverlight

This is my list of what what Microsoft's new years resolutions for Silverlight should be, they are however very unlikely but I think its about time Microsoft take initiative and this about this.

Silverlight 2.0 Alpha in January 2008: Now wouldn't that be cool? Developers/Designers could get their hands dirty with new features in Silverlight 2.0 (grid, controls) and start building meaningful applications that would have compatibility with Silverlight 2.0 plug-in.

Microsoft openly sharing Silverlight information: Am I really asking too much with this? I really don't understand why Microsoft have to be so secretive of their projects, weather it be Silverlight (compared to Adobe) or IE8 (compared to Mozilla). Why can't Microsoft be open and share information or be supportive of early adopters or developers?

Microsoft Expression Exchange: In reality this could only exist in my wish list, Microsoft has never been supportive of its developers, but that was thing of the past Microsoft are not dealing with developers alone anymore, after .NET 3.0 /WPF and Silverlight they are dealing with designers community, Okay, I agree there is not much you can share or exchange as a developer but a designer could share almost anything from simple assets to complex codes, they can share vector graphics for Expression Design, video skins for Expression Encoder, and XAML for Expression Blend. Since announcement of grids/controls in Silverlight applications the need for this kind of exchange program could only result in high productivity

Viewing XAML at Runtime: To me and many other like me this is one feature we would really love to see in the next version of Silverlight , it is easy to create dynamic content in Silverlight but its a real problem to check that XAML for any errors or tweaking. As far as implementation is concerned I don't think its really a problem for Microsoft to allow this but the problem is the shortcut to view XAML as there is no right click available in Silverlight due to compatibility issues with other platforms, and view source will show the HTML file holding XAML.

Microsoft accepting OpenGL and implementing it in Silverlight and the only reason they wouldn't is DirectX, they are simply not going to desert their most prized windows feature they are working on for years on end. I have only one suggestion just in case Microsoft is listening, being stubborn when you are developing next generation cross-platform applications would only restrict progress, there is a first time for everything and Silverlight could be the first time you adopt OpenGL because clearly other platforms are never going to adopt DirectX.

Rich Text Box / integrated HTML object: Probabily the only item in my wish list that is most important and something that can actually come true. This is  very important for RIA web page development, Please check my previous post on Rich Text Box makes rich RIA

Wednesday, December 26, 2007

Silverlight 2.0 - Unicode and Full Font Support

In Silverlight 1.1 Alpha Microsoft included only English Language support  for text and there are only 9 fonts available, 8 normal text fonts and a symbol font without any Unicode support.

Additional font support is available as downloader objects, the font not specified by default in Silverlight applications should be downloaded in cache along with other assets.

The reason for this is that Silverlight 1.1 Alpha applications run in a sandbox within a browser, the font directory is a systems directory and the security restrictions restricts the access of the system directory to the application. Microsoft could have included more fonts for the Silverlight plug-in but to reduce the size of Silverlight plug-in, it was restricted to total of 9 fonts.

However, because of this reason, there is no Unicode support for other languages, if a desired Unicode is required the font should be downloaded as downloader object into the project solution. For complex scripts like Chinese, Japanese, Arabic or Hindi the font size could be anywhere between 6 MB to 12 MB, resulting in the client required to download the font again, where it normally is already available at client's system directory.

Microsoft,  although not officially commented to do "something about it" in Silverlight 2.0 beta, as far as I am concerned it is an entirely essential to include the support. But how Microsoft is going to allow access over cross platform to a system directory from a sandbox,  is yet to be seen, this could easily end up catastrophic and could leak security flaws.

My prediction is that Microsoft is going to follow the same path as Silverlight 1.1 Alpha applications that is loading non available fonts as downloader objects, but at the same time they are going to allow Silverlight plug-in to check the systems directory for the availably of the font and if the font is available then make a copy of the font in the working cache directory for easy access, if no Font is found then it can download the font as a downloader object.

This scenario could solve  the problem not just for Unicode support but makes any Open Type (otf) or True Type (ttf) fonts to be available to the user.

I would rate this feature as a must and Microsoft also realised the issue so do expect to see it in Silverlight 2.0 Beta in March 2008.

Apart from that, I would also like to see the Silverlight SDK engine to allow all fonts available at design time, by automatically including the font in the project solution, not as an embedded resource, but as resource asset

Overall, I hope font support in Silverlight 2.0 will get better but how better depends on how serious Microsoft is going to take this issue. So I would rate this font feature expectancy as 5/5

Friday, December 21, 2007

Silverlight - World Map

I have promised in my previous post about XAML World Map, it  is finally here. Boy it took more time than I thought it would, and it was painstakingly boring, well it is finally here and I have a sample application in Silverlight 1.1 alpha (using VB.NET) how to use the world map.

Few Facts about this XAML World Map

  • Map not for Scale

  • More than 150 countries are included.

  • Each country is held by a canvas, and each child of the canvas is a path.

  • Non-populated or relatively small countries are not included.

  • I have tried my best to be accurate with country names, if there are any mistakes I would update it if brought to my notice.

  • Country canvas's are named by ISO 3166 Country Codes standards, but since ("is", "in", "do" are reserved words other codes are used). 

Countries Not Included. (87)

Country Name
ISO
ÅLAND ISLANDS AX
AMERICAN SAMOA AS
ANDORRA AD
ANGUILLA AI
ANTARCTICA AQ
ANTIGUA AND BARBUDA AG
ARUBA AW
BAHAMAS BS
BAHRAIN BH
BARBADOS BB
BERMUDA BM
BOSNIA AND HERZEGOVINA BA
BOUVET ISLAND BV
BRITISH INDIAN OCEAN TERRITORY IO
CAPE VERDE CV
CHRISTMAS ISLAND CX
COCOS (KEELING) ISLANDS CC
COMOROS KM
COOK ISLANDS CK
CROATIA HR
DJIBOUTI DJ
FALKLAND ISLANDS (MALVINAS) FK
FAROE ISLANDS FO
FIJI FJ
FRENCH POLYNESIA PF
FRENCH SOUTHERN TERRITORIES TF
GIBRALTAR GI
GRENADA GD
GUADELOUPE GP
GUAM GU
GUERNSEY GG
HEARD ISLAND AND MCDONALD ISLANDS HM
HOLY SEE (VATICAN CITY STATE) VA
HONG KONG HK
ISLE OF MAN IM
JERSEY JE
KIRIBATI KI
LIECHTENSTEIN LI
MACAO MO
MACEDONIA, THE FORMER YUGOSLAV REPUBLIC OF MK
MALDIVES MV
MALTA MT
MARSHALL ISLANDS MH
MARTINIQUE MQ
MAURITIUS MU
MAYOTTE YT
MICRONESIA, FEDERATED STATES OF FM
MONACO MC
MONTENEGRO ME
MONTSERRAT MS
NAURU NR
NETHERLANDS ANTILLES AN
NEW CALEDONIA NC
NIUE NU
NORFOLK ISLAND NF
NORTHERN MARIANA ISLANDS MP
PALAU PW
PALESTINIAN TERRITORY, OCCUPIED PS
PITCAIRN PN
PUERTO RICO PR
RÉUNION RE
SAINT BARTHÉLEMY BL
SAINT HELENA SH
SAINT KITTS AND NEVIS KN
SAINT LUCIA LC
SAINT MARTIN MF
SAINT PIERRE AND MIQUELON PM
SAINT VINCENT AND THE GRENADINES VC
SAMOA WS
SAN MARINO SM
SAO TOME AND PRINCIPE ST
SEYCHELLES SC
SLOVENIA SI
SOLOMON ISLANDS SB
SOUTH GEORGIA AND THE SOUTH SANDWICH ISLANDS GS
SVALBARD AND JAN MAYEN SJ
TIMOR-LESTE TL
TOKELAU TK
TONGA TO
TRINIDAD AND TOBAGO TT
TURKS AND CAICOS ISLANDS TC
TUVALU TV
UNITED STATES MINOR OUTLYING ISLANDS UM
VANUATU VU
VIRGIN ISLANDS, BRITISH VG
VIRGIN ISLANDS, U.S. VI
WALLIS AND FUTUNA WF

Countries Included (158)

Country Name 
ISO
AFGHANISTAN AF
ALBANIA AL
ALGERIA DZ
ANGOLA AO
ARGENTINA AR
ARMENIA AM
AUSTRALIA AU
AUSTRIA AT
AZERBAIJAN AZ
BANGLADESH BD
BELARUS BY
BELGIUM BE
BELIZE BZ
BENIN BJ
BHUTAN BT
BOLIVIA BO
BOTSWANA BW
BRAZIL BR
BRUNEI DARUSSALAM BN
BULGARIA BG
BURKINA FASO BF
BURUNDI BI
CAMBODIA KH
CAMEROON CM
CANADA CA
CAYMAN ISLANDS KY
CENTRAL AFRICAN REPUBLIC CF
CHAD TD
CHILE CL
CHINA CN
COLOMBIA CO
CONGO CG
CONGO, THE DEMOCRATIC REPUBLIC OF THE CD
COSTA RICA CR
CÔTE D'IVOIRE CI
CUBA CU
CYPRUS CY
CZECH REPUBLIC CZ
DENMARK DK
DOMINICAN REPUBLIC DO*DOM
ECUADOR EC
EGYPT EG
EL SALVADOR SV
EQUATORIAL GUINEA GQ
ERITREA ER
ESTONIA EE
ETHIOPIA ET
FINLAND FI
FRANCE FR
FRENCH GUIANA GF
GABON GA
GAMBIA GM
GEORGIA GE
GERMANY DE
GHANA GH
GREECE GR
GREENLAND GL
GUATEMALA GT
GUINEA GN
GUINEA-BISSAU GW
GUYANA GY
HAITI HT
HONDURAS HN
HUNGARY HU
ICELAND IS* ICE
INDIA IN* IND
INDONESIA ID
IRAN, ISLAMIC REPUBLIC OF IR
IRAQ IQ
IRELAND IE
ISRAEL IL
ITALY IT
JAMAICA JM
JAPAN JP
JORDAN JO
KAZAKHSTAN KZ
KENYA KE
KOREA, DEMOCRATIC PEOPLE'S REPUBLIC OF KP
KOREA, REPUBLIC OF KR
KUWAIT KW
KYRGYZSTAN KG
LAO PEOPLE'S DEMOCRATIC REPUBLIC LA
LATVIA LV
LEBANON LB
LESOTHO LS
LIBERIA LR
LIBYAN ARAB JAMAHIRIYA LY
LITHUANIA LT
LUXEMBOURG LU
MADAGASCAR MG
MALAWI MW
MALAYSIA MY
MALI ML
MAURITANIA MR
MEXICO MX
MOLDOVA, REPUBLIC OF MD
MONGOLIA MN
MOROCCO MA
MOZAMBIQUE MZ
MYANMAR MM
NAMIBIA NA
NEPAL NP
NETHERLANDS NL
NEW ZEALAND NZ
NICARAGUA NI
NIGER NE
NIGERIA NG
NORWAY NO
OMAN OM
PAKISTAN PK
PANAMA PA
PAPUA NEW GUINEA PG
PARAGUAY PY
PERU PE
PHILIPPINES PH
POLAND PL
PORTUGAL PT
QATAR QA
ROMANIA RO
RUSSIAN FEDERATION RU
RWANDA RW
SAUDI ARABIA SA
SENEGAL SN
SERBIA RS
SIERRA LEONE SL
SINGAPORE SG
SLOVAKIA SK
SOMALIA SO
SOUTH AFRICA ZA
SPAIN ES
SRI LANKA LK
SUDAN SD
SURINAME SR
SWAZILAND SZ
SWEDEN SE
SWITZERLAND CH
SYRIAN ARAB REPUBLIC SY
TAIWAN, PROVINCE OF CHINA TW
TAJIKISTAN TJ
TANZANIA, UNITED REPUBLIC OF TZ
THAILAND TH
TOGO TG
TUNISIA TN
TURKEY TR
TURKMENISTAN TM
UGANDA UG
UKRAINE UA
UNITED ARAB EMIRATES AE
UNITED KINGDOM GB
UNITED STATES US
URUGUAY UY
UZBEKISTAN UZ
VENEZUELA VE
VIET NAM VN
WESTERN SAHARA EH
YEMEN YE
ZAMBIA ZM
ZIMBABWE ZW

Usage in Silverlight

The supported countries are loaded in an Array to create dynamic events on MouseLeftButtonUp, this is to avoid the long Handles phrase.  You can build your own application using this canvas, I didn't include Zoom/Scroll options because I just wanted to provide XAML and to show how to use the XAML from Silverlight. 

I'll update this source code with more information (e.g., area, country, flag etc.) using LINQ/VB XML functions after Silverlight 2.0 Beta is released.

Download

Creative Commons License
This work is licensed under a Creative Commons Licence.

Source Code (Silverlight 1.1 Alpha) VB.NET - WorldMap.zip 

Not Satisfied?

Not satisfied with my work? Change the source code and please post a link in the comments.

Want to redesign yourself? There is the original Microsoft Expression Design file, use it to change it.

Creative Commons License
This work is licensed under a Creative Commons Licence.

WorldMap.Design

Hope you enjoy,  please leave your comments.

PS:  I would appreciate if anyone can host this for me, please provide me a link if you do.