public class UnitUtil extends Object
Constructor and Description |
---|
UnitUtil() |
Modifier and Type | Method and Description |
---|---|
static double |
cmToInche(double cm) |
static int |
cmToPx(double cm) |
static int |
defaultColumnWidthToPx(int columnWidth,
int charWidth)
Convert default columns width (in character) to pixel.
|
static int |
emuToPx(int emu)
convert EMU to pixel, 1 twip == 635 emu
|
static int |
fileChar256ToPx(int char256,
int charWidth)
convert file 1/256 character width to pixel
|
static double |
incheToCm(double inches) |
static int |
incheToPx(double inches) |
static int |
pointToPx(int point)
convert point to pixel
|
static double |
pxToCm(int px) |
static double |
pxToCTChar(int px,
int charWidth) |
static int |
pxToDefaultColumnWidth(int px,
int charWidth)
Convert default column width in pixel to number of character by reverse defaultColumnWidthToPx() and ignore the mod(%) operation.
|
static int |
pxToEmu(int px)
convert pixel to EMU
|
static int |
pxToFileChar256(int px,
int charWidth)
convert pixel to file 1/256 character width
|
static double |
pxToInche(int px) |
static int |
pxToPoint(int px)
convert pixel to point
|
static int |
pxToTwip(int px)
convert pixel to twip (1/20 point)
|
static int |
twipToPx(int twip)
convert twip (1/20 point) to pixel
|
static int |
xssfDefaultColumnWidthToPx(double xssfDefaultColumnWidth,
int charWidth)
Convert XSSF default columns width (in character) to pixel.
|
public static int pxToPoint(int px)
public static int pointToPx(int point)
public static int pxToEmu(int px)
public static int emuToPx(int emu)
public static int twipToPx(int twip)
public static int pxToTwip(int px)
public static int fileChar256ToPx(int char256, int charWidth)
public static int pxToFileChar256(int px, int charWidth)
public static int defaultColumnWidthToPx(int columnWidth, int charWidth)
columnWidth
- number of charactercharWidth
- Using the Calibri font, the maximum digit width of 11 point font size is 7 pixels (at 96 dpi).public static int pxToDefaultColumnWidth(int px, int charWidth)
px
- default column width in pixelcharWidth
- one character width in pixel of normal style's fontpublic static int incheToPx(double inches)
public static double pxToInche(int px)
public static double pxToCTChar(int px, int charWidth)
public static double cmToInche(double cm)
public static double incheToCm(double inches)
public static int cmToPx(double cm)
public static double pxToCm(int px)
public static int xssfDefaultColumnWidthToPx(double xssfDefaultColumnWidth, int charWidth)
columnWidth
- number of charactercharWidth
- Using the Calibri font, the maximum digit width of 11 point font size is 7 pixels (at 96 dpi).Copyright © 2020. All rights reserved.