如何在OpenIMAJ中使用自定义字体

问题描述 投票:0回答:1

我正在开发一个项目,我想使用自定义字体在图像上绘制文本。我不想使用内置的OpenIMAJ字体。有没有办法做到这一点?

java image-processing openimaj
1个回答
0
投票

使用GeneralFont类通过AWT访问所有系统字体:

MBFImage img = new MBFImage( 800, 600, 3 );
img.drawText( "OpenIMAJ", 20, 100, new GeneralFont("Arial", Font.PLAIN ), 120, RGBColour.WHITE );
© www.soinside.com 2019 - 2024. All rights reserved.