Вариант 1: добавляем пакет MS Core Fonts:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Base OS layer | |
FROM openjdk:8-jdk-alpine | |
# Install packages | |
RUN apk --no-cache add curl ttf-dejavu msttcorefonts-installer fontconfig \ | |
&& update-ms-fonts \ | |
&& fc-cache -f |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM openjdk:8-jdk-alpine | |
# Install font file | |
RUN mkdir -p /usr/share/fonts/truetype/myfont | |
COPY MYFONT.TTF /usr/share/fonts/truetype/myfont | |
RUN fc-cache -fv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.awt.GraphicsEnvironment; | |
public class Application { | |
public static void main(String args[]) { | |
GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment(); | |
System.out.println("Avialable fonts:"); | |
for (String fontName : env.getAvailableFontFamilyNames()) { | |
System.out.println(fontName); | |
} | |
} | |
} |
Комментариев нет:
Отправить комментарий