Skip to content

Commit

Permalink
Fix TextTest
Browse files Browse the repository at this point in the history
  • Loading branch information
weisJ committed Sep 9, 2024
1 parent 328991e commit e062b88
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion jsvg/src/test/java/com/github/weisj/jsvg/TextTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
import static org.junit.jupiter.api.Assertions.assertEquals;

import java.awt.geom.AffineTransform;
import java.net.URL;
import java.util.Objects;

Expand All @@ -37,6 +38,7 @@
import com.github.weisj.jsvg.nodes.text.TextOutput;
import com.github.weisj.jsvg.parser.SVGLoader;
import com.github.weisj.jsvg.renderer.NullOutput;
import com.github.weisj.jsvg.renderer.RenderContext;
import com.github.weisj.jsvg.renderer.awt.NullPlatformSupport;

class TextTest {
Expand Down Expand Up @@ -101,7 +103,23 @@ void testExtractingText() {
document.renderWithPlatform(NullPlatformSupport.INSTANCE, new NullOutput() {
@Override
public @NotNull TextOutput textOutput() {
return (codepoint, glyphTransform, context) -> textBuilder.append(codepoint);
return new TextOutput() {
@Override
public void codepoint(@NotNull String codepoint, @NotNull AffineTransform glyphTransform,
@NotNull RenderContext context) {
textBuilder.append(codepoint).append(" ");
}

@Override
public void beginText() {
// Do nothing
}

@Override
public void endText() {
// Do nothing
}
};
}
}, null);

Expand Down

0 comments on commit e062b88

Please sign in to comment.