Search in sources :

Example 1 with Text

use of com.b3dgs.lionengine.graphic.Text in project lionengine by b3dgs.

the class TextAwtTest method testItalic.

/**
 * Test italic.
 */
@Test
public void testItalic() {
    final Text text = Graphics.createText(Constant.FONT_DIALOG, 12, TextStyle.ITALIC);
    text.draw(g, 0, 0, VALUE);
}
Also used : Text(com.b3dgs.lionengine.graphic.Text) Test(org.junit.Test)

Example 2 with Text

use of com.b3dgs.lionengine.graphic.Text in project lionengine by b3dgs.

the class TextAwtTest method testBold.

/**
 * Test bold.
 */
@Test
public void testBold() {
    final Text text = Graphics.createText(Constant.FONT_DIALOG, 12, TextStyle.BOLD);
    text.draw(g, 0, 0, VALUE);
}
Also used : Text(com.b3dgs.lionengine.graphic.Text) Test(org.junit.Test)

Example 3 with Text

use of com.b3dgs.lionengine.graphic.Text in project lionengine by b3dgs.

the class TextAwtTest method testAlignUnknown.

/**
 * Test align unknown.
 */
@Test
public void testAlignUnknown() {
    final Text text = Graphics.createText(Constant.FONT_DIALOG, 12, TextStyle.NORMAL);
    try {
        final Graphic g = Graphics.createGraphic();
        g.setGraphic(ToolsAwt.createImage(1, 1, java.awt.Transparency.OPAQUE).createGraphics());
        text.draw(g, 0, 0, UtilEnum.make(Align.class, "FAIL"), Constant.EMPTY_STRING);
        Assert.fail();
    } catch (final LionEngineException exception) {
        Assert.assertNotNull(exception);
    }
}
Also used : Align(com.b3dgs.lionengine.Align) LionEngineException(com.b3dgs.lionengine.LionEngineException) Graphic(com.b3dgs.lionengine.graphic.Graphic) Text(com.b3dgs.lionengine.graphic.Text) Test(org.junit.Test)

Example 4 with Text

use of com.b3dgs.lionengine.graphic.Text in project lionengine by b3dgs.

the class TextAwtTest method testBold.

/**
 * Test bold.
 */
@Test
void testBold() {
    final Text text = Graphics.createText(Constant.FONT_DIALOG, 12, TextStyle.BOLD);
    text.draw(g, 0, 0, VALUE);
}
Also used : Text(com.b3dgs.lionengine.graphic.Text) Test(org.junit.jupiter.api.Test)

Example 5 with Text

use of com.b3dgs.lionengine.graphic.Text in project lionengine by b3dgs.

the class TextHeadlessTest method testItalic.

/**
 * Test italic.
 */
@Test
void testItalic() {
    final Text text = Graphics.createText(Constant.FONT_DIALOG, 12, TextStyle.ITALIC);
    text.draw(g, 0, 0, VALUE);
}
Also used : Text(com.b3dgs.lionengine.graphic.Text) Test(org.junit.jupiter.api.Test)

Aggregations

Text (com.b3dgs.lionengine.graphic.Text)11 Test (org.junit.jupiter.api.Test)7 Test (org.junit.Test)4 Graphic (com.b3dgs.lionengine.graphic.Graphic)2 Align (com.b3dgs.lionengine.Align)1 LionEngineException (com.b3dgs.lionengine.LionEngineException)1