public class Units
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static float |
DEFAULT_CHARACTER_WIDTH
Width of one "standard character" of the default font in pixels.
|
static int |
EMU_PER_CENTIMETER |
static int |
EMU_PER_CHARACTER
Column widths are in fractional characters, this is the EMU equivalent.
|
static int |
EMU_PER_PIXEL
In Escher absolute distances are specified in
English Metric Units (EMUs), occasionally referred to as A units;
there are 360000 EMUs per centimeter, 914400 EMUs per inch, 12700 EMUs per point.
|
static int |
EMU_PER_POINT |
static int |
MASTER_DPI
Master DPI (576 pixels per inch).
|
static int |
PIXEL_DPI
Pixels DPI (96 pixels per inch)
|
static int |
POINT_DPI
Points DPI (72 pixels per inch)
|
Constructor and Description |
---|
Units() |
Modifier and Type | Method and Description |
---|---|
static int |
charactersToEMU(double characters) |
static int |
columnWidthToEMU(int columnWidth) |
static int |
doubleToFixedPoint(double floatPoint)
Converts a value of type floating point to a FixedPoint
|
static double |
fixedPointToDouble(int fixedPoint)
Converts a value of type FixedPoint to a floating point
|
static double |
masterToPoints(int masterDPI) |
static int |
pixelToEMU(int pixels)
Converts pixels to EMUs
|
static double |
pixelToPoints(int pixel) |
static int |
pointsToMaster(double points) |
static int |
pointsToPixel(double points) |
static int |
toEMU(double points)
Converts points to EMUs
|
static double |
toPoints(long emu)
Converts EMUs to points
|
static int |
TwipsToEMU(short twips) |
public static final int EMU_PER_PIXEL
public static final int EMU_PER_POINT
public static final int EMU_PER_CENTIMETER
public static final int MASTER_DPI
public static final int PIXEL_DPI
public static final int POINT_DPI
public static final float DEFAULT_CHARACTER_WIDTH
Note this is only valid for workbooks using the default Excel font.
Would be nice to eventually support arbitrary document default fonts.
public static final int EMU_PER_CHARACTER
public static int toEMU(double points)
points
- pointspublic static int pixelToEMU(int pixels)
pixels
- pixelspublic static double toPoints(long emu)
emu
- emupublic static double fixedPointToDouble(int fixedPoint)
fixedPoint
- value in fixed point notationpublic static int doubleToFixedPoint(double floatPoint)
floatPoint
- value in floating point notationpublic static double masterToPoints(int masterDPI)
public static int pointsToMaster(double points)
public static int pointsToPixel(double points)
public static double pixelToPoints(int pixel)
public static int charactersToEMU(double characters)
public static int columnWidthToEMU(int columnWidth)
columnWidth
- specified in 256ths of a standard characterpublic static int TwipsToEMU(short twips)
twips
- (1/20th of a point) typically used for row heightsCopyright 2018 The Apache Software Foundation or its licensors, as applicable.