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.
(列宽以小数字符表示,这是 EMU 等价物。)
|
static int |
EMU_PER_DXA
EMU_PER_POINT/20
(EMU_PER_POINT / 20)
|
static int |
EMU_PER_INCH
72 points per inch (dpi)
(每英寸 72 点 (dpi))
|
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.
(在 Escher 中,绝对距离以英制公制单位 (EMU) 指定,有时称为 A 单位;每厘米有 360000 个 EMU,每英寸有 914400 个 EMU,每点有 12700 个 EMU。)
|
static int |
EMU_PER_POINT |
static int |
MASTER_DPI
Master DPI (576 pixels per inch).
(主 DPI(每英寸 576 像素)。)
|
static int |
PIXEL_DPI
Pixels DPI (96 pixels per inch)
(像素 DPI(每英寸 96 像素))
|
static int |
POINT_DPI
Points DPI (72 pixels per inch)
(点 DPI(每英寸 72 像素))
|
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
(将浮点类型的值转换为 FixedPoint)
|
static double |
fixedPointToDouble(int fixedPoint)
Converts a value of type FixedPoint to a floating point
(将 FixedPoint 类型的值转换为浮点数)
|
static double |
masterToPoints(int masterDPI) |
static int |
pixelToEMU(int pixels)
Converts pixels to EMUs
(将像素转换为 EMU)
|
static java.awt.geom.Dimension2D |
pixelToPoints(java.awt.geom.Dimension2D pointsDim) |
static double |
pixelToPoints(double pixel) |
static java.awt.geom.Rectangle2D |
pixelToPoints(java.awt.geom.Rectangle2D pointsDim) |
static int |
pointsToMaster(double points) |
static java.awt.geom.Dimension2D |
pointsToPixel(java.awt.geom.Dimension2D pointsDim) |
static int |
pointsToPixel(double points) |
static java.awt.geom.Rectangle2D |
pointsToPixel(java.awt.geom.Rectangle2D pointsDim) |
static double |
toDXA(long emu) |
static int |
toEMU(double points)
Converts points to EMUs
(将积分转换为 EMU)
|
static double |
toPoints(long emu)
Converts EMUs to points
(将 EMU 转换为点)
|
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 EMU_PER_INCH
public static final int EMU_PER_DXA
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.
(默认字体的一个“标准字符”的宽度(以像素为单位)。 Calibri 和 Arial 也是如此。 “标准字符”定义为给定字体中最宽的数字字符。从 XSSFWorkbook 复制,因为这里不可用。请注意,这仅对使用默认 Excel 字体的工作簿有效。最终支持任意文档默认字体会很好。)public static final int EMU_PER_CHARACTER
public static int toEMU(double points)
points
- points
(点-点)
public static int pixelToEMU(int pixels)
pixels
- pixels
(像素 - 像素)
public static double toPoints(long emu)
emu
- emu
(鸸鹋——鸸鹋)
public static double fixedPointToDouble(int fixedPoint)
fixedPoint
- value in fixed point notation
(fixedPoint - 定点符号中的值)
public static int doubleToFixedPoint(double floatPoint)
floatPoint
- value in floating point notation
(floatPoint - 浮点表示法中的值)
public static double masterToPoints(int masterDPI)
public static int pointsToMaster(double points)
public static int pointsToPixel(double points)
public static double pixelToPoints(double pixel)
public static java.awt.geom.Dimension2D pointsToPixel(java.awt.geom.Dimension2D pointsDim)
public static java.awt.geom.Dimension2D pixelToPoints(java.awt.geom.Dimension2D pointsDim)
public static java.awt.geom.Rectangle2D pointsToPixel(java.awt.geom.Rectangle2D pointsDim)
public static java.awt.geom.Rectangle2D pixelToPoints(java.awt.geom.Rectangle2D pointsDim)
public static int charactersToEMU(double characters)
public static int columnWidthToEMU(int columnWidth)
columnWidth
- specified in 256ths of a standard character
(columnWidth - 以标准字符的 256 分之一指定)
public static double toDXA(long emu)
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.