()
| 116 | static FONT: OnceLock<Font> = OnceLock::new(); |
| 117 | |
| 118 | fn get_font() -> &'static Font<'static> { |
| 119 | FONT.get_or_init(|| Font::try_from_bytes(FONT_DATA).expect("Error constructing Font")) |
| 120 | } |
| 121 | |
| 122 | /// 在图像上绘制文字 |
| 123 | pub fn put_text(mat: &mut Mat, text: &str, org: Point, font_scale: f32, color: Scalar) { |