Browse our Products

<dependency>
<groupId>com.aspose</groupId>
<artifactId>aspose-font</artifactId>
<version>24.10</version>
</dependency>
copied!  
                                                
                                                  compile(group: 'com.aspose', name: 'aspose-font', version: '24.10')
                                                
                                              
copied!  
<dependency org="com.aspose" name="aspose-font" rev="24.10">
 <artifact name="aspose-font" ext="jar"/>
</dependency>
copied!  
libraryDependencies += "com.aspose" % "aspose-font" % "24.10"
copied!  

Java API for Various Font Formats

main-banner

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 and OpenType 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 and Type1 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

VersionRelease Date
24.10November 1, 2024
24.9September 17, 2024
24.7July 9, 2024
24.5May 28, 2024
24.4April 9, 2024
23.12December 22, 2023
23.11November 15, 2023
23.10October 19, 2023
23.9September 5, 2023
23.8August 14, 2023
23.7July 19, 2023
23.6June 21, 2023
23.4April 4, 2023
23.2February 22, 2023
23.1January 26, 2023
22.12December 29, 2022
22.11November 21, 2022
22.10November 3, 2022
22.9September 21, 2022
22.7July 28, 2022
22.6June 21, 2022
21.12December 9, 2021
21.10October 13, 2021
21.8August 25, 2021
21.4April 20, 2021
20.10October 15, 2020