java.lang.Objectcom.aspose.words.FontInfoCollection
public class FontInfoCollection
Items are You do not create instances of this class directly.
Use the Example:
Document doc = new Document(getMyDir() + "Document.doc");
FontInfoCollection fonts = doc.getFontInfos();
int fontIndex = 1;
// The fonts info extracted from this document does not necessarily mean that the fonts themselves are
// used in the document. If a font is present but not used then most likely they were referenced at some time
// and then removed from the Document.
for (FontInfo info : fonts)
{
// Print out some important details about the font.
System.out.println(MessageFormat.format("Font #{0}", fontIndex));
System.out.println(MessageFormat.format("Name: {0}", info.getName()));
System.out.println(MessageFormat.format("IsTrueType: {0}", info.isTrueType()));
fontIndex++;
}
Property Getters/Setters Summary | ||
---|---|---|
int | getCount() | |
Gets the number of elements contained in the collection. | ||
boolean | getEmbedSystemFonts() | |
void | setEmbedSystemFonts(boolean value) | |
Specifies whether or not to embed System fonts into the document. Default value for this property is false. This option works only when |
||
boolean | getEmbedTrueTypeFonts() | |
void | setEmbedTrueTypeFonts(boolean value) | |
Specifies whether or not to embed TrueType fonts in a document when it is saved. Default value for this property is false. | ||
boolean | getSaveSubsetFonts() | |
void | setSaveSubsetFonts(boolean value) | |
Specifies whether or not to save a subset of the embedded TrueType fonts with the document. Default value for this property is false. This option works only when |
||
FontInfo | get(int index) | |
Gets a font at the specified index. | ||
FontInfo | get(java.lang.String name) | |
Gets a font with the specified name. |
Method Summary | ||
---|---|---|
boolean | contains(java.lang.String name) | |
Determines whether the collection contains a font with the given name. | ||
java.util.Iterator | iterator() | |
Returns an iterator object that can be used to iterate over all items in the collection. |
Property Getters/Setters Detail |
---|
getCount | |
public int getCount() |
getEmbedSystemFonts/setEmbedSystemFonts | |
public boolean getEmbedSystemFonts() / public void setEmbedSystemFonts(boolean value) |
Specifies whether or not to embed System fonts into the document. Default value for this property is false.
This option works only when
Setting this property to True
is useful if the user is on an East Asian system
and wants to create a document that is readable by others who do not have fonts for that
language on their system. For example, a user on a Japanese system could choose to embed the
fonts in a document so that the Japanese document would be readable on all systems.
This option works for DOC, DOCX and RTF formats only.
getEmbedTrueTypeFonts/setEmbedTrueTypeFonts | |
public boolean getEmbedTrueTypeFonts() / public void setEmbedTrueTypeFonts(boolean value) |
Embedding TrueType fonts allows others to view the document with the same fonts that were used to create it, but may substantially increase the document size.
This option works for DOC, DOCX and RTF formats only.
getSaveSubsetFonts/setSaveSubsetFonts | |
public boolean getSaveSubsetFonts() / public void setSaveSubsetFonts(boolean value) |
Specifies whether or not to save a subset of the embedded TrueType fonts with the document. Default value for this property is false.
This option works only when
get | |
public FontInfo get(int index) |
index
- Zero-based index of the font.get | |
public FontInfo get(java.lang.String name) |
name
- Case-insensitive name of the font to locate.Method Detail |
---|
contains | |
public boolean contains(java.lang.String name) |
name
- Case-insensitive name of the font to locate.iterator | |
public java.util.Iterator iterator() |