A set of TTF/OTF OSS fonts to be used in PDF creation or any other use case. It wraps the TTF/OTF files in a Java resource and provides reasonable APIs.
The original use case was the easy support of fonts for https://github.com/phax/ph-pdf-layout/
Add the following to your pom.xml to use this project, replacing x.y.z with the real version number:
<dependency>
<groupId>com.helger.font</groupId>
<artifactId>ph-fonts-api</artifactId>
<version>x.y.z</version>
</dependency>
<dependency>
<groupId>com.helger.font</groupId>
<!-- replace XXX with one of the list below -->
<artifactId>XXX</artifactId>
<version>x.y.z</version>
</dependency>Note: prior to v4.1.0 the Maven groupId was com.helger.
Available artefacts including the fonts are:
- ph-fonts-alegreya-sans
- ph-fonts-anaheim
- ph-fonts-exo2
- ph-fonts-lato2
- ph-fonts-kurinto-mono (since v5.0.2)
- ph-fonts-kurinto-sans (since v5.0.2)
- ph-fonts-markazi (since v4.1.1)
- ph-fonts-noto-sans-hk (since v4.1.2)
- ph-fonts-noto-sans-sc (since v4.1.2)
- ph-fonts-noto-sans-tc (since v5.0.4)
- ph-fonts-open-sans
- ph-fonts-roboto
- ph-fonts-source-sans-pro (since v4.0.1)
- ph-fonts-source-sans3 (since v5.0.2)
To add a different font using ph-fonts-api just use one of the above mentioned projects. Should be quite self explanatory.
v6.1.0 - 2025-11-16
- Updated to ph-commons 12.1.0
- Using JSpecify annotations
v6.0.0 - 2025-08-24
- Requires Java 17 as the minimum version
- Updated to ph-commons 12.0.0
v5.0.4 - 2025-03-27
- Added new font
Noto Sans TCfor Traditional Chinese characters. See #4 - thx @paoyuan - Updated
AnaheimTTFs
v5.0.3 - 2024-09-18
- Reverted to the
AnaheimTTF from v5.0.1 as the new TTF was not compatible with PDFBox - Added unit tests to make sure all contained TTFs/OTFs are processable by PDFBox to avoid such error in the future
- Created the new internal test-only submodule
ph-fonts-testfor the specific tests
v5.0.2 - 2024-09-17
- Added support for
Kurinto SansandKurinto Mono. See #3 - thx @erdincay - Updated
AnaheimTTFs - Updated
Open SansTTFs - Removed
Open SansMedium TTFs again - Added support for
Source Sans3as the successor font ofSource Sans Pro
v5.0.1 - 2023-04-27
- Updated
Alegreya SansTTFs. See #2 - thx @fheldt - Updated
AnaheimTTFs - Updated
Exo2TTFs - Updated
Markazi TextTTFs - Updated
Noto Sans HKTTFs - Updated
Noto Sans SCTTFs - Updated
Open SansTTFs - Added
Open SansMedium TTFs - Updated
RobotoTTFs - Updated
Roboto CondensedTTFs - Updated
Source Sans ProTTFs
v5.0.0 - 2022-09-13
- Requires Java 11 as the minimum version
- Updated to ph-commons 11
v4.2.0 - 2021-03-21
- Updated to ph-commons 10
v4.1.2 - 2020-11-19
- Added new fonts
Noto Sans SCandNoto Sans HKfor Chinese characters. See ph-pdf-layout#19
v4.1.1 - 2020-06-15
- Added new font
Markazi Textfor Arabic characters. See issue #1 - thx @Sasan-Yavari
v4.1.0 - 2020-05-26
- Changed the "groupId" of the Maven artefacts to
com.helger.font
v4.0.2 - 2020-03-28
- Updated to ph-commons 9.4.0
v4.0.1 - 2018-08-22
- Really fixed OSGI ServiceProvider configuration
- Fixed OSGI ServiceProvider configuration
- Added new font
Source Sans Proin artefactph-fonts-source-sans-pro - Updated
RobotoTTFs - Updated
Open SansTTFs - Updated
Lato2OTFs to v2.015 - Updated
Exo2to use TTF - Updated
AnaheimTTFs - Updated
Alegreya SansTTFs
v4.0.0 - 2017-11-05
- Updated to ph-commons 9.0.0
v3.1.1 - 2016-07-26
- Updated to ph-commons 8.2.x
v3.1.0 - 2016-06-29
- Updated to ph-commons 8.1.x
v3.0.0 - 2016-06-10
- Requires JDK 8
v2.1.0 - 2015-12-01
- Introducing a completely new layout so there is a common "ph-fonts-api" project and per font a sub-project so that the amount of loaded data can be kept quite small.
My personal Coding Styleguide | It is appreciated if you star the GitHub project if you like it.