Namespaces

Variants
Actions

Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

Archived:SVG rendering problems caused by missing viewBox attribute (Known Issue)

From Wiki
Jump to: navigation, search

Archived.pngArchived: This article is archived because it is not considered relevant for third-party developers creating commercial solutions today. If you think this article is still relevant, let us know by adding the template {{ReviewForRemovalFromArchive|user=~~~~|write your reason here}}.

SVG-T graphics files that are missing a viewBox attribute in their header fail to render correctly on S60 3rd Edition devices.

Article Metadata
Compatibility
Platform(s): S60 3rd Edition, S60 3rd Edition FP1
S60 3rd Edition FP1
S60 3rd Edition (initial release)
Article
Created: User:Technical writer 1 (20 Aug 2007)
Last edited: hamishwillee (21 Jun 2012)

Description

SVG-T graphics files that are missing a viewBox attribute in their header fail to render correctly on S60 3rd Edition devices. Specifically, trying to scale the SVG image (AknIconUtils::SetSize()) does not produce correct results.

SVG-T implementation on S60 2nd Edition, FP3 does not require the viewBox attribute to be specified.

Solution

In addition to width and height attributes, also viewBox must be specified in the 'svg' element of the SVG file header.

For example,

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
<svg baseProfile="tiny" xmlns="http://www.w3.org/2000/svg" width="64px" height="64px">
...

--> should be:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
<svg baseProfile="tiny" xmlns="http://www.w3.org/2000/svg" width="64px" height="64px" viewBox="0 0 64 64">
...
This page was last modified on 21 June 2012, at 05:15.
83 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×