Browse our Products
<dependency>
<groupId>com.aspose</groupId>
<artifactId>aspose-font</artifactId>
<version>24.10</version>
</dependency>
compile(group: 'com.aspose', name: 'aspose-font', version: '24.10')
<dependency org="com.aspose" name="aspose-font" rev="24.10">
<artifact name="aspose-font" ext="jar"/>
</dependency>
libraryDependencies += "com.aspose" % "aspose-font" % "24.10"
Java API for Various Font Formats
Product Page | Docs | API Reference | Examples | Blog | Search | Free Support | Temporary License
Aspose.Font for Java is a font loading and drawing library. It supports multiple front formats such as TrueType (with TrueType collectons), CFF, OpenType, and Type1. The API provides rich functionality to load/save font and provide information about its data structures along with any glyph that is supported by all the font types. It also provides encoding information for all the font types which represents a mapping between character codes and glyph identifiers. Its rendering subsystem helps end-users to render any desired glyph or text. Special glyphs can be rendered by implementing interface using simple graphics functionality (move point, draw line, curve).
Font API Features
- Load font files from disc as well as stream.
- Read font information and save updated font files to disc.
- Support for
TrueType
andOpenType
Fonts. - Load
TrueType
Font types from locally stored files, update parameters and save. - Work with Glyphs and Metrics of
TrueType
Fonts. - Render text using
TrueType
andType1
font. - Detect Latin Symbols in Fonts.
- Load and extract data from
Type1
Font stored at the local disc. - Work with Glyphs and Metrics of
Type1
Fonts. - Render text using custom interfaces.
For a more comprehensive list of features, please visit Feature Overview.
Read & Write Font Formats
TTF
Read Font Formats
TTC, OpenType, CFF, Type1
Supported Environments
- Microsoft Windows: Windows Desktop & Server (x86, x64), Windows Azure
- macOS: Mac OS X
- Linux: Ubuntu, CentOS, and others
- Java Versions:
J2SE 8.0 (1.8)
or above.
Get Started
Aspose.Font Java APIs are hosted at the Aspose Repository. You can easily use Aspose.Font for Java API directly in your Maven projects with simple configurations. For the detailed instructions please visit Installing Aspose.Font for Java from Maven Repository documentation page.
Detect Latin Symbols Support in the Font using Java
// For complete examples and data files, please go to https://github.com/aspose-font/Aspose.Font-for-Java
String fileName = Utils.getDataDir() + "Montserrat-Regular.ttf"; //Font file name with full path
FontDefinition fd = new FontDefinition(FontType.TTF, new FontFileDefinition("ttf", new FileSystemStreamSource(fileName)));
TtfFont ttfFont = (TtfFont) Font.open(fd);
boolean latinText = true;
for (int code = 65; code < 123; code++)
{
GlyphId gid = ttfFont.getEncoding().decodeToGid(code);
if (gid == null || gid == GlyphUInt32Id.getNotDef())
{
latinText = false;
}
}
if (latinText)
{
System.out.println(MessageFormat.format("Font {0} supports latin symbols.", ttfFont.getFontName()));
}
else
{
System.out.println(MessageFormat.format("Latin symbols are not supported by font {0}.", ttfFont.getFontName()));
}
Product Page | Docs | API Reference | Examples | Blog | Search | Free Support | Temporary License
Version | Release Date |
---|---|
24.10 | November 1, 2024 |
24.9 | September 17, 2024 |
24.7 | July 9, 2024 |
24.5 | May 28, 2024 |
24.4 | April 9, 2024 |
23.12 | December 22, 2023 |
23.11 | November 15, 2023 |
23.10 | October 19, 2023 |
23.9 | September 5, 2023 |
23.8 | August 14, 2023 |
23.7 | July 19, 2023 |
23.6 | June 21, 2023 |
23.4 | April 4, 2023 |
23.2 | February 22, 2023 |
23.1 | January 26, 2023 |
22.12 | December 29, 2022 |
22.11 | November 21, 2022 |
22.10 | November 3, 2022 |
22.9 | September 21, 2022 |
22.7 | July 28, 2022 |
22.6 | June 21, 2022 |
21.12 | December 9, 2021 |
21.10 | October 13, 2021 |
21.8 | August 25, 2021 |
21.4 | April 20, 2021 |
20.10 | October 15, 2020 |
Aspose Total Aspose Font Aspose Java API font java library font java class TTF TTC OpenType CFF Type1 postscript scalabale font true type compact font latin font symbols glyphs font rendering render text Windows Linux Mac J2SE Maven font converter font conversion WOFF WOFF2 EOT TTF to WOFF TTF to WOFF2 WOFF to TTF WOFF to WOFF2 WOFF2 to TTF WOFF2 to WOFF EOT to TTF EOT to WOFF EOT to WOFF2 Type1 to TFF Type1 to WOFF Type1 to WOFF2 CFF to TTF CFF to WOFF CFF to WOFF2 load font