Skip to content

Commit

Permalink
Add Myriad fonts
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesbarnett91 committed Nov 24, 2023
1 parent 4ec2fe4 commit 13390e2
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,21 @@ public void registerFonts() {

LOGGER.info("Arial-bold loaded {}", arialBoldLoaded);

boolean myriadProLoaded = GraphicsEnvironment.getLocalGraphicsEnvironment().registerFont(
Font.createFont(Font.TRUETYPE_FONT, new ClassPathResource("fonts/myriad-pro.ttf").getInputStream()));

LOGGER.info("Myriad Pro loaded {}", myriadProLoaded);

boolean myriadProBoldLoaded = GraphicsEnvironment.getLocalGraphicsEnvironment().registerFont(
Font.createFont(Font.TRUETYPE_FONT, new ClassPathResource("fonts/myriad-pro-bold.ttf").getInputStream()));

LOGGER.info("Myriad Pro Bold loaded {}", myriadProBoldLoaded);

boolean myriadProSemiBoldLoaded = GraphicsEnvironment.getLocalGraphicsEnvironment().registerFont(
Font.createFont(Font.TRUETYPE_FONT, new ClassPathResource("fonts/myriad-pro-semibold.ttf").getInputStream()));

LOGGER.info("Myriad Pro Semi Bold loaded {}", myriadProSemiBoldLoaded);

LOGGER.info("Available system fonts are:");
Arrays.stream(GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames()).forEach(f ->
LOGGER.info("Font: {}", f)
Expand Down
Binary file added src/main/resources/fonts/myriad-pro-bold.ttf
Binary file not shown.
Binary file added src/main/resources/fonts/myriad-pro-semibold.ttf
Binary file not shown.
Binary file added src/main/resources/fonts/myriad-pro.ttf
Binary file not shown.
15 changes: 15 additions & 0 deletions src/main/resources/labels/html-wrapper.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,21 @@
src: url('fonts/arial.ttf');
}

@font-face {
font-family: Myriad Pro;
src: url('fonts/myriad-pro.ttf');
}

@font-face {
font-family: MyriadPro-Bold;
src: url('fonts/myriad-pro-bold.ttf');
}

@font-face {
font-family: MyriadPro-Semibold;
src: url('fonts/myriad-pro-semibold.ttf');
}

</style>
<title id="html-title"></title>
</head>
Expand Down

0 comments on commit 13390e2

Please sign in to comment.