package de.lessvoid.nifty.slick2d.render.font; import org.newdawn.slick.SlickException; import org.newdawn.slick.UnicodeFont; import javax.annotation.Nonnull; import java.awt.*; /** * This render font implementation uses a unicode font to draw the text on the screen. * * @author Martin Karing <nitram@illarion.org> */ public class UnicodeSlickRenderFont extends AbstractJavaSlickRenderFont { /** * The constructor to create this unicode font based render font. * * @param ucFont the unicode font that is used to render * @param javaFont the java font that is used to render just the same font * @throws SlickLoadFontException in case loading the font fails */ public UnicodeSlickRenderFont(@Nonnull final UnicodeFont ucFont, final Font javaFont) throws SlickLoadFontException { super(ucFont, javaFont); try { ucFont.loadGlyphs(); } catch (@Nonnull final SlickException e) { throw new SlickLoadFontException("Failed preparing font.", e); } } }