| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| use crate::models; |
| use serde::{Deserialize, Serialize}; |
|
|
| #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] |
| pub struct FontPrediction { |
| #[serde(rename = "angleDeg")] |
| pub angle_deg: f32, |
| #[serde(rename = "direction")] |
| pub direction: models::TextDirection, |
| #[serde(rename = "fontSizePx")] |
| pub font_size_px: f32, |
| #[serde(rename = "lineHeight")] |
| pub line_height: f32, |
| #[serde(rename = "namedFonts")] |
| pub named_fonts: Vec<models::NamedFontPrediction>, |
| #[serde(rename = "strokeColor")] |
| pub stroke_color: Vec<u32>, |
| #[serde(rename = "strokeWidthPx")] |
| pub stroke_width_px: f32, |
| #[serde(rename = "textColor")] |
| pub text_color: Vec<u32>, |
| #[serde(rename = "topFonts")] |
| pub top_fonts: Vec<models::TopFont>, |
| } |
|
|
| impl FontPrediction { |
| pub fn new( |
| angle_deg: f32, |
| direction: models::TextDirection, |
| font_size_px: f32, |
| line_height: f32, |
| named_fonts: Vec<models::NamedFontPrediction>, |
| stroke_color: Vec<u32>, |
| stroke_width_px: f32, |
| text_color: Vec<u32>, |
| top_fonts: Vec<models::TopFont>, |
| ) -> FontPrediction { |
| FontPrediction { |
| angle_deg, |
| direction, |
| font_size_px, |
| line_height, |
| named_fonts, |
| stroke_color, |
| stroke_width_px, |
| text_color, |
| top_fonts, |
| } |
| } |
| } |
|
|