()
| 79 | |
| 80 | #[test] |
| 81 | fn test_text_3d() -> Result<(), StrError> { |
| 82 | // text object and options |
| 83 | let mut text = Text::new(); |
| 84 | text.set_color("blue") |
| 85 | .set_align_horizontal("center") |
| 86 | .set_align_vertical("center") |
| 87 | .set_fontsize(32.0) |
| 88 | .set_bbox(true) |
| 89 | .set_bbox_facecolor("pink") |
| 90 | .set_bbox_edgecolor("black") |
| 91 | .set_bbox_alpha(0.3); |
| 92 | |
| 93 | // draw text |
| 94 | text.draw_3d(0.5, 0.5, 0.5, "message: $\\frac{\\alpha}{\\beta} = \\gamma$"); |
| 95 | |
| 96 | // add text to plot |
| 97 | let mut plot = Plot::new(); |
| 98 | plot.add(&text); |
| 99 | |
| 100 | // save figure |
| 101 | let path = Path::new(OUT_DIR).join("integ_text_3d.svg"); |
| 102 | plot.save(&path)?; |
| 103 | |
| 104 | // check number of lines |
| 105 | let file = File::open(path).map_err(|_| "cannot open file")?; |
| 106 | let buffered = BufReader::new(file); |
| 107 | let lines_iter = buffered.lines(); |
| 108 | assert!(lines_iter.count() > 800); |
| 109 | Ok(()) |
| 110 | } |
nothing calls this directly
no test coverage detected