The current Windows Phone 8 versions do not support web fonts loaded from a local CSS file when used in PhoneGap or HTML5 applications. Unfortunately, there are no known workarounds yet. Use the images for icons when targeting WP8 applications.
The Kendo UI Hybrid framework includes 38 integrated font icons, which can be used directly in a Kendo UI project intended to run on mobile devices by specifying a data-icon attribute with any of the icon names listed below, which are supported by all Button widgets and ListView items.
In addition to these icons, there are more icons available inside the font file distributed with the Kendo UI Hybrid framework. For a full list of them, check this section of the article.
To manually prepare the icon, SVG, and fonts.
Using Fontello is pretty straightforward—pick the icons, choose the Unicode characters for them, type a font name, and click Download to get a .zip file with the needed for mobile TTF and WOFF font formats, which can be directly used for icons. From the other files in there, EOT is not needed as it targets only Internet Explorer 6 to 8 versions and the SVG font can be used to further the modification.
The manual approach is considerably more difficult. First, create the desired icons using a vector editing software such as Inkscape or Adobe Illustrator. Export them to the SVG format. Consult these articles about SVG font creation using Inkscape. Import the SVG icons in Inkscape and create the SVG font icon by icon, assigning them to separate characters. After creating the SVG font, convert it to TTF/WOFF formats, using the Online Font Converter or other similar service.
The example below demonstrates how to load the two fonts (TTF/WOFF) with @font-face.
The example below demonstrates how to override the Kendo UI font for all icons. Note that, alternatively, separate classes can be used to override them one by one.
The example below demonstrates how to specify the character corresponding to every custom icon.
In the example, mycustomicon is the icon name set in the data-icon attribute and \E03a is the Unicode character code of the icon.
As of Kendo UI Q3 2012, the hybrid framework employs an icon font for its icon rendering. To be able to render it in most of the supported mobile and desktop browsers, two font formats included in the Kendo UI distribution exist—TTF and WOFF. Most web servers do not support serving these fonts with a specific mime type. Since currently there is no standardized mime type for fonts, you only need to serve them both with mime type application/octet-stream or you can come up with any valid mime type such as application/x-font-ttf and application/x-font-woff, for example.
The two mime types can be specified either through the IIS management console (inetmgr) or in the site Web.config.
The example below demonstrates how to configure IIS Web.config.
Removing the mime type first avoids clashes if the mime types for these files are already defined. Note that IIS throws exception if they are. These can be removed if not needed.
Apache configuration in some distributions includes mime-types application/x-font-ttf and application/x-font-woff by default. If these mime types are not listed, they can be added easily.
The example below demonstrates how to configure Apache in .htaccess.
The example below demonstrates how to configure the Apache mime.types file.
For Nginx the configuration is similar.
The example below demonstrates how to configure the Nginx mime.types file.
Since fonts are usually copyrighted, most browsers do not allow using them across different domains. If serving multiple domains from one font location is needed, the fonts should be served with an Access-Control-Allow-Origin header. This header also supports using * instead of the domain name list, and while using it for normal text fonts is not advisable, it can be freely used for our icon font if the icons are living in a Kendo UI hybrid application.
The example demonstrates how to configure IIS by placing a web.config in the font folder and adding the code below to it.
The example demonstrates how to configure Apache.
The example demonstrates how to configure Nginx.
To use any image for an icon in the Kendo UI hybrid framework, raise the specificity of the background-image style to at least 40 to override the defaults. Use background-size to resize the image accordingly.
The example below demonstrates how to define custom background-image icon.
To use colorizable icon masks, specify the icon image as a box mask—either as dataURI or as a separate image. The image should be PNG8 or PNG24 with alpha channel. Note that PNG8+Alpha is supported only by few graphic editors, so you'd better stick to PNG24 if not sure. The image color is not important—it is going to be used as a mask only—the alpha transparency clips the colorized content.
WebKit masks have numerous bugs across most platforms, so consider using them only if necessary.
In Android and MeeGo WebKit masks are unreliable—they can be turned into colorized rectangles by a simple CSS transformation in the wrong place. In BBOS 7.0 WebKit masks are completely broken—though they work in BBOS 6.0 and 7.1.
The example below demonstrates how to define a custom WebKit mask for an icon.
WebKit masks are now deprecated for Android mobile applications, where background: url() should be used instead. WebKit masks can still be used in iOS applications.
In Kendo UIQ3 2012 WebKit mask icons were deprecated due to numerous issues with them and the Kendo UI hybrid framework introduced font icons. This change requires the usage of additional styling to enable the WebKit masks as icons.
This example demonstrates how to define custom icon after Kendo UI Q3 2012. Note that the the code from below is going to disable all font icons.
If you want to add only one or two custom icons, specify them with their respective classes—.km- + data-icon name. The example below demonstrates how to restyle only the custom icons.
When custom icons are used and their names are the same as the integrated Kendo UI hybrid icon names, make sure that the font icons are not rendered. The example below demonstrates how to hide all Kendo UI hybrid font icons.
Again, if only several icons should be overridden, specify them with their classes instead. The example below demonstrates how to hide only one Kendo UI hybrid font icon.
Windows Phone 8.0 has some severe issues that may affect your icons usage. First of all, masks are not supported in any way—Firefox allows SVG mask usage, WebKit/Blink have image masks, although broken in Android. If you plan to have only a web application that runs in the browser, you can go for font icons as they look better across different resolutions and can be colorized. The default Kendo UI hybrid icons work as any icon font such as Font Awesome. Learn more about using font icons and Font Awesome from this blog post.
However, if you plan to create a hybrid application with PhoneGap or HTML5 template in WP8 SDK, font icons do not work there—the WebView does not load them at all. Kendo UI provides image replacements for its default icons, but if you want custom ones, you are left out with only normal images/backgrounds and you need to provide one for normal and another one for the selected state, if they differ. You should also think about the dark and light background themes in WP8, as the Kendo UI hybrid framework automatically supports them in Cordova.
The example below demonstrates how the WP8 application icon backgrounds are defined in the Kendo UI hybrid framework.
The sprite is laid out horizontally and background-size and background-position-x are used to specify the icon offsets. This is done to allow the icon to be resized with its container size. You do not need your icons to have circles around them, as they are defined in CSS just for the TabStrip.
The icon font shipped with the Kendo UI hybrid distribution contains much more icons than the 34 defined ones—about ten times more than that. The reason for this is that the framework aims at keeping its CSS small. To use them, choose an icon from the list below and add a definition for it in your CSS using its Unicode character code. Make sure you have a km- prefix.
Now you are able to specify it as a data-icon="arrow-e" in your application.
Keep in mind that icons with Unicode codes from \e0ca to \e0f0 are the original Kendo UI hybrid icons listed at the beginning of this article. Also, the ones starting from \e200 are already defined and in use, but only in the iOS7 platform theme and are available as of Kendo UI Q2 2013 SP.