Skip to main content
← Back to kicad-monkey Rust Docs kicad-monkey Rust Crate API Reference

kicad_monkey_contracts/generated/
font_bundle_manifest.rs

1/// Error types.
2pub mod error {
3    /// Error from a `TryFrom` or `FromStr` implementation.
4    pub struct ConversionError(::std::borrow::Cow<'static, str>);
5    impl ::std::error::Error for ConversionError {}
6    impl ::std::fmt::Display for ConversionError {
7        fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> Result<(), ::std::fmt::Error> {
8            ::std::fmt::Display::fmt(&self.0, f)
9        }
10    }
11    impl ::std::fmt::Debug for ConversionError {
12        fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> Result<(), ::std::fmt::Error> {
13            ::std::fmt::Debug::fmt(&self.0, f)
14        }
15    }
16    impl From<&'static str> for ConversionError {
17        fn from(value: &'static str) -> Self {
18            Self(value.into())
19        }
20    }
21    impl From<String> for ConversionError {
22        fn from(value: String) -> Self {
23            Self(value.into())
24        }
25    }
26}
27///One font face whose bytes are supplied in a separate binary slot.
28///
29/// <details><summary>JSON schema</summary>
30///
31/// ```json
32///{
33///  "description": "One font face whose bytes are supplied in a separate binary slot.",
34///  "type": "object",
35///  "required": [
36///    "aliases",
37///    "face_index",
38///    "id",
39///    "sha256",
40///    "slot",
41///    "variations"
42///  ],
43///  "properties": {
44///    "aliases": {
45///      "type": "array",
46///      "items": {
47///        "type": "string"
48///      }
49///    },
50///    "face_index": {
51///      "type": "integer",
52///      "maximum": 4294967295.0,
53///      "minimum": 0.0
54///    },
55///    "family": {
56///      "type": "string"
57///    },
58///    "id": {
59///      "$ref": "#/$defs/StableTextId"
60///    },
61///    "postscript_name": {
62///      "type": "string"
63///    },
64///    "sha256": {
65///      "$ref": "#/$defs/Sha256Hex"
66///    },
67///    "slot": {
68///      "type": "integer",
69///      "maximum": 4294967295.0,
70///      "minimum": 0.0
71///    },
72///    "style": {
73///      "type": "string"
74///    },
75///    "variations": {
76///      "type": "array",
77///      "items": {
78///        "$ref": "#/$defs/FontVariationCoordinate"
79///      }
80///    }
81///  },
82///  "additionalProperties": false
83///}
84/// ```
85/// </details>
86#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
87#[serde(deny_unknown_fields)]
88pub struct FontBundleEntry {
89    pub aliases: ::std::vec::Vec<::std::string::String>,
90    pub face_index: u32,
91    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
92    pub family: ::std::option::Option<::std::string::String>,
93    pub id: crate::StableTextId,
94    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
95    pub postscript_name: ::std::option::Option<::std::string::String>,
96    pub sha256: Sha256Hex,
97    pub slot: u32,
98    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
99    pub style: ::std::option::Option<::std::string::String>,
100    pub variations: ::std::vec::Vec<FontVariationCoordinate>,
101}
102///Metadata for font buffers supplied out of band in matching numeric slots.
103///
104/// <details><summary>JSON schema</summary>
105///
106/// ```json
107///{
108///  "$id": "urn:wavenumber:schema:kicad_monkey.font_bundle:a0",
109///  "title": "Font bundle manifest a0",
110///  "description": "Metadata for font buffers supplied out of band in matching numeric slots.",
111///  "type": "object",
112///  "required": [
113///    "fonts",
114///    "schema",
115///    "type",
116///    "version"
117///  ],
118///  "properties": {
119///    "fonts": {
120///      "type": "array",
121///      "items": {
122///        "$ref": "#/$defs/FontBundleEntry"
123///      }
124///    },
125///    "schema": {
126///      "type": "string",
127///      "const": "kicad_monkey.font_bundle.a0"
128///    },
129///    "type": {
130///      "type": "string",
131///      "const": "kicad_monkey.font_bundle"
132///    },
133///    "version": {
134///      "type": "string",
135///      "const": "a0"
136///    }
137///  },
138///  "additionalProperties": false
139///}
140/// ```
141/// </details>
142#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
143#[serde(deny_unknown_fields)]
144pub struct FontBundleManifestA0 {
145    pub fonts: ::std::vec::Vec<FontBundleEntry>,
146    pub schema: ::std::string::String,
147    #[serde(rename = "type")]
148    pub type_: ::std::string::String,
149    pub version: ::std::string::String,
150}
151///One ordered OpenType variation coordinate.
152///
153/// <details><summary>JSON schema</summary>
154///
155/// ```json
156///{
157///  "description": "One ordered OpenType variation coordinate.",
158///  "type": "object",
159///  "required": [
160///    "axis",
161///    "value"
162///  ],
163///  "properties": {
164///    "axis": {
165///      "$ref": "#/$defs/OpenTypeTag"
166///    },
167///    "value": {
168///      "$ref": "#/$defs/FiniteFloat"
169///    }
170///  },
171///  "additionalProperties": false
172///}
173/// ```
174/// </details>
175#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
176#[serde(deny_unknown_fields)]
177pub struct FontVariationCoordinate {
178    pub axis: OpenTypeTag,
179    pub value: crate::FiniteFloat,
180}
181///Four-byte OpenType variation or feature tag.
182///
183/// <details><summary>JSON schema</summary>
184///
185/// ```json
186///{
187///  "description": "Four-byte OpenType variation or feature tag.",
188///  "type": "string"
189///}
190/// ```
191/// </details>
192#[derive(
193    ::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd,
194)]
195#[serde(transparent)]
196pub struct OpenTypeTag(pub ::std::string::String);
197impl ::std::ops::Deref for OpenTypeTag {
198    type Target = ::std::string::String;
199    fn deref(&self) -> &::std::string::String {
200        &self.0
201    }
202}
203impl ::std::convert::From<OpenTypeTag> for ::std::string::String {
204    fn from(value: OpenTypeTag) -> Self {
205        value.0
206    }
207}
208impl ::std::convert::From<::std::string::String> for OpenTypeTag {
209    fn from(value: ::std::string::String) -> Self {
210        Self(value)
211    }
212}
213impl ::std::str::FromStr for OpenTypeTag {
214    type Err = ::std::convert::Infallible;
215    fn from_str(value: &str) -> ::std::result::Result<Self, Self::Err> {
216        Ok(Self(value.to_string()))
217    }
218}
219impl ::std::fmt::Display for OpenTypeTag {
220    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
221        self.0.fmt(f)
222    }
223}
224///Lowercase SHA-256 digest for one out-of-band font buffer.
225///
226/// <details><summary>JSON schema</summary>
227///
228/// ```json
229///{
230///  "description": "Lowercase SHA-256 digest for one out-of-band font buffer.",
231///  "type": "string"
232///}
233/// ```
234/// </details>
235#[derive(
236    ::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd,
237)]
238#[serde(transparent)]
239pub struct Sha256Hex(pub ::std::string::String);
240impl ::std::ops::Deref for Sha256Hex {
241    type Target = ::std::string::String;
242    fn deref(&self) -> &::std::string::String {
243        &self.0
244    }
245}
246impl ::std::convert::From<Sha256Hex> for ::std::string::String {
247    fn from(value: Sha256Hex) -> Self {
248        value.0
249    }
250}
251impl ::std::convert::From<::std::string::String> for Sha256Hex {
252    fn from(value: ::std::string::String) -> Self {
253        Self(value)
254    }
255}
256impl ::std::str::FromStr for Sha256Hex {
257    type Err = ::std::convert::Infallible;
258    fn from_str(value: &str) -> ::std::result::Result<Self, Self::Err> {
259        Ok(Self(value.to_string()))
260    }
261}
262impl ::std::fmt::Display for Sha256Hex {
263    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
264        self.0.fmt(f)
265    }
266}