CanIUse.com

To check for an API / html tag support on various browsers and mobile devices. E.g.

http://caniuse.com/filesystem

Css3 : Units Conversion

Using PTs :
PT units should only be used for printable Form CSS as they represent the DOts on the printer / papper.

Using PX:
PX unit repsent a pixel on screen and should only be used for displayable Forms only. Drawback is if user changes the base font size of the browser, your fonts will be still of same size. they won't grow along with your base font size.
Use PX for Icons, Images width / height etc as they are pixel perfect.

Using EMs :
EM units are relative and scalable along with your base font size and W3C best practices guidelines recommend using EMs whenever possible.

If you are planning to use Ems in your CSS, be aware that EMs are compounding and relative to parent element Font size.

useful Regx for conversion :


    String regexDecimal = "(\\d+(\\.\\d+)?)";
    String regexPT = regexDecimal + "pt";
    String regexPX = regexDecimal + "px";
    String regexCSS = "\\s*:\\s*";

    String convert( String line, String regX, float convertFactor, String suffix )
    {
        Pattern pt = Pattern.compile( regX, Pattern.CASE_INSENSITIVE );
        Matcher ptMatcher = pt.matcher( line );

        StringBuffer s = new StringBuffer();
        while( ptMatcher.find() )
        {
            float i = Float.parseFloat( ptMatcher.group( 1 ) );
            float f = i / convertFactor;
            String em = String.format( "%.3f", Float.valueOf( f ) ) + suffix; 
            ptMatcher.appendReplacement( s, em );
        }
        ptMatcher.appendTail( s );
        return s.toString();
    }


Converting PTs to PX

12 PT = 16 PX
so to convert pt to PX just multiply the PTs by 1.333. However for accuracy instead divide the PTs by 0.75

String input = "font-size: 12pt; hello 12pt; 12.0pt convert another14pt16px8px:";
convert( input, regexPT, (float) 0.75, "px" );

Converting for a specific style e.g. Font-Size:

To convert Pixel to EMs (16 PX = 1 EM). So divide the PXs by 16.

    String line = "font-size: 12pt;";
    convertCSS( line, "font-size:" + regexCSS,
                regexPX, (float) 16.0, "em" );

    String convertCSS( String line, String style, String regX, float convertFactor, String suffix )
    {
        Pattern pt1 = Pattern.compile( "(" + style + ")", Pattern.CASE_INSENSITIVE ); 
        Matcher pt1Matcher = pt1.matcher( line );
        boolean regXMatches = false;
        StringBuffer s = new StringBuffer();
        while( pt1Matcher.find() )
        {
            Pattern pt = Pattern.compile( regX, Pattern.CASE_INSENSITIVE );
            Matcher ptMatcher = pt.matcher( line );

            while( ptMatcher.find() )
            {
                float i = Float.parseFloat( ptMatcher.group( 1 ) );
                float f = i / convertFactor;
                String em = String.format( "%.3f", Float.valueOf( f ) ) + suffix; 
                ptMatcher.appendReplacement( s, em );
            }
            ptMatcher.appendTail( s );
            regXMatches = true;
        }
        if( !regXMatches )
        {
            pt1Matcher.appendTail( s );
        }
        return s.toString();
    }


Here is the conversion table : http://reeddesign.co.uk/test/points-pixels.html

Centimeters to PX conversion : http://www.unitconversion.org/typography/centimeters-to-pixels-y-conversion.html