public class NumSpacing
extends java.lang.Object
Examples:
Shows how to set the spacing type of the numeral.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
// This effect is only supported in newer versions of MS Word.
doc.getCompatibilityOptions().optimizeFor(MsWordVersion.WORD_2019);
builder.write("1 ");
builder.write("This is an example");
Run run = doc.getFirstSection().getBody().getFirstParagraph().getRuns().get(0);
if (run.getFont().getNumberSpacing() == NumSpacing.DEFAULT)
run.getFont().setNumberSpacing(NumSpacing.PROPORTIONAL);
doc.save(getArtifactsDir() + "Fonts.NumberSpacing.docx");
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT
Specifies that numerals are displayed in the font’s default form.
|
static int |
length |
static int |
PROPORTIONAL
Specifies that the forms of the numerals designed as proportionally spaced are displayed if supported by the font.
|
static int |
TABULAR
Specifies that the forms of the numerals designed as tabular are displayed if supported by the font.
|
| Modifier and Type | Method and Description |
|---|---|
static int |
fromName(java.lang.String numSpacingName) |
static java.lang.String |
getName(int numSpacing) |
static int[] |
getValues() |
static java.lang.String |
toString(int numSpacing) |
public static int DEFAULT
public static int PROPORTIONAL
public static int TABULAR
public static int length