I am playing with CSS to try and get a hang of setting my font sizes based on
a device's DPI.  I did not set the applicationDPI at the application level,
assuming that if it is not set, it will set itself to an appropriate DPI
bucket.  Then, I trace the applicationDPI and the Capabilities.screenDPI. 
When I debug it on my iPad, it traces that it's Capabilities.screenDPI is
264, which according to the link below, should map the device to a DPI
bucket of 240.  But it traces the applicationDPI as 320, and the CSS rule
that it is selecting is the 320 rule.  How do I get the application to set
the applicationDPI to 240 when the Capabilities.screenDPI is 264, and force
it to use the 240 CSS rule?

https://flex.apache.org/asdoc/mx/core/RuntimeDPIProvider.html#includeExamplesSummary
<https://flex.apache.org/asdoc/mx/core/RuntimeDPIProvider.html#includeExamplesSummary>
  

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"; 
                           xmlns:s="library://ns.adobe.com/flex/spark"
applicationComplete="appCreationCompleteHandler(event)"
creationPolicy="all">
        
        <fx:Style>
                @namespace s "library://ns.adobe.com/flex/spark";
                @namespace mx "library://ns.adobe.com/flex/mx";
                
                @media (application-dpi: 160) {
                        s|Label {
                                fontSize: 40;
                        }
                }
                
                @media (application-dpi: 240) {
                        s|Label {
                                fontSize: 100;
                        }
                }
                
                @media (application-dpi: 320) {
                        s|Label {
                                fontSize: 15;
                        }
                }
                
                
        </fx:Style>
        <fx:Script>
                
        </fx:Script>
        
        <s:Label id="testText" horizontalCenter="0" verticalCenter="-300"/>
        
</s:Application>




--
View this message in context: 
http://apache-flex-users.2333346.n4.nabble.com/Wrong-CSS-DPI-Buckets-Being-Chosen-tp14779.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Reply via email to