| 1056 | |
| 1057 | #[test] |
| 1058 | fn test_font() { |
| 1059 | |
| 1060 | let mut img = RgbImage::new(300, 300); |
| 1061 | let f = vec![ |
| 1062 | Font::new(FontFace::CvFontHersheySimplex), |
| 1063 | Font::new(FontFace::CvFontHersheyComplex), |
| 1064 | Font::new(FontFace::CvFontHersheyComplexSmall), |
| 1065 | Font::new(FontFace::CvFontHersheyDuplex), |
| 1066 | Font::new(FontFace::CvFontHersheyPlain), |
| 1067 | Font::new(FontFace::CvFontHersheyScriptComplex), |
| 1068 | Font::new(FontFace::CvFontHersheyScriptSimplex), |
| 1069 | Font::new(FontFace::CvFontHersheyTriplex), |
| 1070 | ]; |
| 1071 | for i in (0..8) { |
| 1072 | img.draw_text("hallo", 10, i * 20 + 20, f.get(i).unwrap()); |
| 1073 | } |
| 1074 | img.to_file("/tmp/blabla.jpg"); |
| 1075 | } |
| 1076 | } |