Search in sources :

Example 26 with Text

use of net.sf.latexdraw.model.api.shape.Text in project latexdraw by arnobl.

the class TestParsingPsframebox method testParsepsdblframeboxstar.

@Test
public void testParsepsdblframeboxstar() {
    parser("\\psdblframebox*{\\psframe(0,1)}");
    assertEquals(1, parsedShapes.size());
    final Text text = getShapeAt(0);
    assertEquals("\\psdblframebox*{\\psframe(0,1)}", text.getText());
}
Also used : Text(net.sf.latexdraw.model.api.shape.Text) Test(org.junit.jupiter.api.Test)

Example 27 with Text

use of net.sf.latexdraw.model.api.shape.Text in project latexdraw by arnobl.

the class TestTextParsing method testParseTextfootnotesize.

@Test
public void testParseTextfootnotesize() {
    parser("\\rput(1,2){\\footnotesize coucou}");
    assertEquals(1, parsedShapes.size());
    final Text text = getShapeAt(0);
    assertEquals("\\footnotesize coucou", text.getText());
}
Also used : Text(net.sf.latexdraw.model.api.shape.Text) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 28 with Text

use of net.sf.latexdraw.model.api.shape.Text in project latexdraw by arnobl.

the class TestTextParsing method testParseTexttiny.

@Test
public void testParseTexttiny() {
    parser("\\rput(1,2){\\tiny coucou}");
    assertEquals(1, parsedShapes.size());
    final Text text = getShapeAt(0);
    assertEquals("\\tiny coucou", text.getText());
}
Also used : Text(net.sf.latexdraw.model.api.shape.Text) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 29 with Text

use of net.sf.latexdraw.model.api.shape.Text in project latexdraw by arnobl.

the class TestTextParsing method testTextWithSpecialColour.

@Test
public void testTextWithSpecialColour() {
    parser("\\definecolor{color0}{rgb}{0.5,0.5,0.5}\\color{color0}foo");
    final Text txt = getShapeAt(0);
    assertNotNull(txt);
    assertEquals(ShapeFactory.INST.createColor(0.5, 0.5, 0.5), txt.getLineColour());
}
Also used : Text(net.sf.latexdraw.model.api.shape.Text) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 30 with Text

use of net.sf.latexdraw.model.api.shape.Text in project latexdraw by arnobl.

the class TestTextParsing method testBug7220753.

@Test
public void testBug7220753() {
    // https://bugs.launchpad.net/latexdraw/+bug/722075
    parser("\\textcolor{blue}{xyz} foobar");
    assertEquals(2, parsedShapes.size());
    final Text text = getShapeAt(1);
    assertEquals("foobar", text.getText());
    assertEquals(DviPsColors.BLACK, text.getLineColour());
}
Also used : Text(net.sf.latexdraw.model.api.shape.Text) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Aggregations

Text (net.sf.latexdraw.model.api.shape.Text)67 Test (org.junit.jupiter.api.Test)53 Test (org.junit.Test)10 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)10 HelperTest (net.sf.latexdraw.HelperTest)6 Rectangle (net.sf.latexdraw.model.api.shape.Rectangle)2 ExecutionException (java.util.concurrent.ExecutionException)1 Point2D (javafx.geometry.Point2D)1 Axes (net.sf.latexdraw.model.api.shape.Axes)1 BezierCurve (net.sf.latexdraw.model.api.shape.BezierCurve)1 Circle (net.sf.latexdraw.model.api.shape.Circle)1 CircleArc (net.sf.latexdraw.model.api.shape.CircleArc)1 Dot (net.sf.latexdraw.model.api.shape.Dot)1 Ellipse (net.sf.latexdraw.model.api.shape.Ellipse)1 Freehand (net.sf.latexdraw.model.api.shape.Freehand)1 Grid (net.sf.latexdraw.model.api.shape.Grid)1 Plot (net.sf.latexdraw.model.api.shape.Plot)1 Polygon (net.sf.latexdraw.model.api.shape.Polygon)1 Polyline (net.sf.latexdraw.model.api.shape.Polyline)1 Rhombus (net.sf.latexdraw.model.api.shape.Rhombus)1