Package io.keikai.api

Class UnitUtil


  • public class UnitUtil
    extends java.lang.Object
    Utility for transferring unit
    Since:
    3.0.0
    Author:
    dennis
    • Constructor Summary

      Constructors 
      Constructor Description
      UnitUtil()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static int char256ToPx​(int width256, int charWidthPx)
      convert column width(char 256) to pixel
      static int emuToPx​(int emu)
      convert EMU to pixel, 1 twip == 635 emu
      static int pointToPx​(int point)  
      static int pointToTwip​(int point)  
      static int pxToEmu​(int px)
      convert pixel to EMU
      static int pxToPoint​(int px)  
      static int pxToTwip​(int px)  
      static int twipToPoint​(int twip)
      convert row height(twip) to point(font size)
      static int twipToPx​(int twip)
      convert row height(twip) to pixel
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • UnitUtil

        public UnitUtil()
    • Method Detail

      • pxToPoint

        public static int pxToPoint​(int px)
      • pointToPx

        public static int pointToPx​(int point)
      • pxToEmu

        public static int pxToEmu​(int px)
        convert pixel to EMU
      • emuToPx

        public static int emuToPx​(int emu)
        convert EMU to pixel, 1 twip == 635 emu
      • char256ToPx

        public static int char256ToPx​(int width256,
                                      int charWidthPx)
        convert column width(char 256) to pixel
        Returns:
        the width in pixel
      • twipToPx

        public static int twipToPx​(int twip)
        convert row height(twip) to pixel
        Returns:
        the height in pixel
      • pxToTwip

        public static int pxToTwip​(int px)
      • twipToPoint

        public static int twipToPoint​(int twip)
        convert row height(twip) to point(font size)
        Returns:
        the height in pixel
      • pointToTwip

        public static int pointToTwip​(int point)