first commit

This commit is contained in:
2026-08-20 22:22:27 +08:00
commit b2b863366f
27 changed files with 203 additions and 0 deletions
+6
View File
@@ -0,0 +1,6 @@
[package]
name = "mark-engine"
version = "0.1.0"
edition = "2024"
[dependencies]
+14
View File
@@ -0,0 +1,14 @@
pub fn add(left: u64, right: u64) -> u64 {
left + right
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn it_works() {
let result = add(2, 2);
assert_eq!(result, 4);
}
}
@@ -0,0 +1,10 @@
pub struct BorderStyle(pub String);
impl BorderStyle {
pub const NONE: Self = Self("None");
pub const SOLID: Self = Self("SOLID");
pub const DASHED: Self = Self("DASHED");
pub const DOTTED: Self = Self("DOTTED");
fn check() {}
}
+1
View File
@@ -0,0 +1 @@
+14
View File
@@ -0,0 +1,14 @@
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
pub struct FontSize(pub f32);
impl FontSize {
pub const SMALL: Self = Self(12);
pub const NORMAL: Self = Self(14);
pub const MEDIUM: Self = Self(16);
pub const LARGE: Self = Self(24);
pub const X_LARGE: Self = Self(30);
pub fn as_f32(&self) -> f32 {
self.0
}
}
@@ -0,0 +1,14 @@
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
pub struct FontWeight(pub f32);
impl FontWeight {
pub const LIGHT: Self = Self(300);
pub const NORMAL: Self = Self(400);
pub const MEDIUM: Self = Self(500);
pub const SEMIBOLD: Self = Self(600);
pub const BOLD: Self = Self(700);
pub fn as_f32(&self) -> f32 {
self.0
}
}
@@ -0,0 +1,10 @@
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
pub struct LineHeight(pub f32);
impl LineHeight {
pub const LINE_HEIGHT_NORMAL: Self = Self(1.4);
pub fn as_f32(&self) -> f32 {
self.0
}
}
+18
View File
@@ -0,0 +1,18 @@
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
pub struct Width(pub f32);
impl Width {
pub const ITEM_WIDTH_SMALL: Self = Self(20);
pub const ITEM_WIDTH_NORMAL: Self = Self(24);
pub const ITEM_WIDTH_MEDIUM: Self = Self(28);
pub const ITEM_WIDTH_LARGE: Self = Self(34);
pub const ITEM_WIDTH_X_LARGE: Self = Self(44);
pub const ITEM_WIDTH_XX_LARGE: Self = Self(56);
pub const ITEM_WIDTH_XXX_LARGE: Self = Self(64);
pub const INLINE_WIDTH_SMALL: Self = Self(64);
pub fn as_f32(&self) -> f32 {
self.0
}
}