Skip to main content

Crate grafia

Crate grafia 

Source
Expand description

§grafia

Interactive 2D Cubic Bézier, Spline, Vector & Typography Canvas Widget for egui

Crates.io Docs.rs egui 0.37 forbid(unsafe_code) License: MIT OR Apache-2.0

grafia — Interactive 2D Vector & Typography Canvas for egui

Try the live interactive desktop showcase in one command:

cargo run --example vector_canvas_demo

§1. Why grafia?

grafia is a zero-unsafe, battery-efficient, drop-in 2D vector and spline canvas widget for egui, built on the Linebender geometry stack (kurbo), lyon_tessellation, and tiny-skia.

Rather than locking your application into a rigid document format or monolithic editor shell, grafia operates as a Hexagonal Data-In / Event-Out View & Controller: your host application feeds pure 2D scene geometry into GrafiaCanvasState, renders GrafiaCanvasWidget inside any egui::Ui, and drains strongly-typed semantic events and mutations from the host-port queues.

§Built for Four Core Domains

  1. Vector Illustration & SVG Editors
    • Persistent cubic Bézier pen & select state machines, tension-controlled Hobby splines (NodeType::HobbyStar) and $G^2$ Euler/Spiro spirals (NodeType::EulerSpiro).
    • Exact Boolean Pathfinder operations (remove_overlap_in_contours, subtract_contours, intersect_contours), recursive De Casteljau Knife slicing, geometric Primitives (rectangles, ellipses), freehand Pencil curve fitting, and Multi-Layer Vector Color/Gradients (Solid, LinearGradient, RadialGradient, SweepGradient, Bitmap, ClippingMask) with interactive on-canvas gradient stop handles.
  2. Typeface & Font Engineering
    • Native UPM (FontUnit / FontPoint) coordinate space, foreground/background layers, 2D Anchors with diacritic mark-cloud overlays (GhostMarkPath), and pre-resolved Components with parametric Smart Handles (CanvasSmartHandle).
    • Interactive Multi-Glyph Text Streams (WritingDirection::LeftToRight horizontal and WritingDirection::TopToBottom vertical CJK layout) with live in-canvas spacing (LSB/RSB/TSB/BSB) and pair kerning deltas.
    • Variable-font Companion Master Compatibility diagnostics, Higher-Order Interpolation (HOI) control-polygon overlays, and PostScript / TrueType Hinting visual instructors.
  3. 2D CAD, CAM, Plotter & Profile Editors
    • Type-safe bijective coordinate transforms (FontPoint $\leftrightarrow$ ScreenPoint), domain-agnostic Custom Reference Frames (CustomReferenceFrame with outer/inner bounds, $N_x \times N_y$ grids, keyline circles, and zoom-scaling band lines), top/left UPM rulers, magnetic SnapEngine, and live Measurement Rays with typographic angle and span readouts.
  4. Bitmap-to-Vector Digitization
    • Built-in deterministic 7-stage Bitmap & Camera Auto-Trace (trace_background_image) featuring Sauvola integral-image adaptive thresholding, $3\times 3$ homography perspective deskew, marching squares, Ramer-Douglas-Peucker simplification, and Schneider least-squares cubic Bézier fitting.

§2. Quick Start

Add grafia to your Cargo.toml and drop GrafiaCanvasWidget into any egui::Ui:

use grafia::{
    CanvasHostRequest, ContourId, Glyph, GlyphContour, GlyphMetrics,
    GrafiaCanvasState, GrafiaCanvasWidget, GrafiaTheme, Node, NodeId, NodeType,
};

// 1. Initialize the theme and canvas state once in your application struct:
let theme = GrafiaTheme::sonoma_default();
let mut state = GrafiaCanvasState::new(theme.clone());

// 2. Load a 2D vector shape or glyph into the hexagonal Data-In port:
let contour = GlyphContour::new(
    ContourId(0),
    vec![
        Node::new(NodeId(1), 100.0, 0.0, NodeType::Corner),
        Node::new(NodeId(2), 350.0, 700.0, NodeType::Corner),
        Node::new(NodeId(3), 600.0, 0.0, NodeType::Corner),
    ],
);
let glyph = Glyph {
    name: "A".to_string(),
    upm: 1000,
    width: 700.0,
    height: 700.0,
    contours: vec![contour],
    ..Glyph::default()
};
state.load_glyph(glyph, GlyphMetrics::default());

// 3. Inside your egui update loop, render the widget and poll Event-Out requests:
fn update_canvas(ui: &mut egui::Ui, state: &mut GrafiaCanvasState, theme: &GrafiaTheme) {
    let _response = GrafiaCanvasWidget::new(state, theme).show(ui);

    for request in state.drain_host_requests() {
        if let CanvasHostRequest::OpenComponentSource { id, component_name } = request {
            let _ = (id, component_name);
        }
    }
}

§3. Visual Feature Showcase

Dark Mode Cubic Bézier & Measurement GuidesLight Mode Rulers, Background Layer & 2D Anchors
Dark Mode Cubic Bézier & GuidesLight Mode Rulers & 2D Anchors
Full dark-mode wireframe editing with cubic off-curve handles, angled measurement guide with live span/angle telemetry pills, alignment zone badges, and bottom filled preview strip.Precision top/left UPM rulers with cursor hairlines, rose background reference layer, named 2D anchors (top, bottom, ogonek), and live glyph metrics HUD.
Multi-Glyph Text Stream & Live KerningLive Contour Stroke & Master Compatibility
Multi-Glyph Text Stream & KerningLive Contour Stroke & Master Compatibility
Interactive multi-glyph text run (AonsA) with caret navigation, text range selection, beneath-slot LSB/RSB/kerning readouts, and synchronized separable-blur bottom preview strip.Non-destructive calligraphic stroke expansion (ContourStrokeStyle with round caps/joins) alongside variable-font companion master compatibility diagnostics.

§4. Hexagonal Host-Port Architecture (Data-In / Event-Out)

grafia never couples your application to a specific disk format (such as UFO, OTF/TTF, SVG, or DXF). All communication flows through deterministic, serializable Rust value types:

flowchart LR
    Host["Host Application<br/>(Font Editor / SVG Studio / CAD Tool)"]
    State["GrafiaCanvasState<br/>(2D CAGD Solvers, 14 Tools, Undo/Redo)"]
    Widget["GrafiaCanvasWidget<br/>(5-Pass egui::Painter & tiny-skia Verifier)"]

    Host -->|"Data-In: Glyph, CanvasTextStream,<br/>CanvasColorSublayer, CustomReferenceFrame,<br/>GrafiaPreferences"| State
    State -->|"content_generation() Cache Gate<br/>(0% CPU Idle)"| Widget
    State -->|"Event-Out: CanvasHostRequest,<br/>SpacingDelta, KerningDelta,<br/>SelectionInfoAction"| Host

§5. Feature Matrix

Capability PillarHighlights
Curve & Spline MathematicsCubic Béziers (Corner, Smooth, OffCurve), tension-controlled Hobby splines (NodeType::HobbyStar), $G^2$ Euler/Spiro spirals (NodeType::EulerSpiro), 4-mode inverse-Bernstein belly dragging (apply_cubic_segment_belly_drag), curve-healing deletion (heal_delete_nodes), De Casteljau splitting, extremum & inflection insertion, and 8-step fit_selected_curves_step (apply_fit_curve_ratio_to_contours).
14 Interactive Canvas ToolsSelect (V), Lasso (Shift+V), Pen (P), Rotate (R), Scale (S), Zoom (Z), Knife (E), Primitives (F), Measurement (L), Annotation (A), Pencil (B), Pixel (X), Text (T), TrueTypeInstructor, and Hoi.
Boolean Pathfinder & TopologyExact cubic-cubic intersection graph solver for Union (remove_overlap_in_contours), Subtract (subtract_contours), and Intersect (intersect_contours), plus correct_path_direction_layer, tidy_up_contours, align_selected_nodes, and virtual self-intersection ExtraNodes.
Snapping, Rulers & Reference FramesMagnetic SnapEngine across metric lines, alignment zones, local/global guides (GuideThickness::ScreenDp and zoom-scaling GuideThickness::FontUnits), nodes, 2D anchors, background contours, and CustomReferenceFrame grids/keyline circles.
Multi-Glyph Text & TypographyHorizontal (LeftToRight) and vertical CJK (TopToBottom) multi-glyph streams (CanvasTextStream), double-click slot activation, keyboard spacing (LSB/RSB/TSB/BSB) & pair kerning adjustments, 2D CanvasAnchors with GhostMarkPath clouds, CanvasComponents with parametric CanvasSmartHandles, PostScript stem/ghost hints, and TrueType visual instructions.
Color Layers & Bitmap Auto-TraceMulti-layer vector paint (Solid, LinearGradient, RadialGradient, SweepGradient, Bitmap, ClippingMask) with Porter-Duff SrcOver compositing and on-canvas gradient handles; 7-stage deterministic bitmap & camera auto-trace (trace_background_image).
Performance & Safety Guarantees#![forbid(unsafe_code)], #![forbid(dead_code)], zero .unwrap() / .expect() in production code, monotonic content_generation() cache gating for 0% CPU idle frames, and 1:1 visual parity between egui::Painter and headless tiny_skia::Pixmap.

§6. Architecture, Module Map & Developer Guides (src/)

Each module includes an in-depth mathematical and conceptual guide rendered on docs.rs (with KaTeX formula support):

Moduledocs.rs Developer GuideResponsibility
coreCore Math, Splines, Topology & Auto-TraceType-safe coordinates (FontUnit, FontPoint, ScreenDp, ScreenPoint, ViewportTransform), cubic Bézier & Hobby/Euler-Spiro spline math, 4-case inverse-Bernstein belly dragging, boolean pathfinder, knife, primitives, measurement rays, color layers, hinting/HOI models, and 7-stage Sauvola/Schneider bitmap auto-trace.
interactionTool State Machines & Transactional Undo/RedoDeterministic finite state machines (SelectToolState, PenToolState, CanvasGesture), keyboard modifiers, and atomic CommandHistory (GlyphSnapshot undo/redo).
snappingMagnetic Snapping, Guides & Reference FramesPriority-based magnetic SnapEngine, local and global Guide management (ScreenDp vs. zoom-scaling FontUnits), AlignmentZone overshoot badges, CustomReferenceFrame, and GlyphMetrics.
render5-Pass Pipeline, Tessellation & Zero-CPU CachingGPU tessellation (tessellate_contours_nonzero, tessellate_contours_even_odd), view-mode projections (EditWireframe, PreviewFilled, ShapeThumbnail), separable Gaussian blur GrafiaPreviewWidget (PreviewStripCache), and content_generation() cache gating.
locatorMinimap ProjectionsShapeLocatorRenderer & ShapeLocatorWidget 2-layer vector minimap with Non-Zero Winding counter reconstruction and CCW/CW winding indicators.
adaptersHexagonal Host-Port & Headless VerificationGrafiaCanvasState (with load_glyph, export_glyph, load_document_scene, and hexagonal host ports), GrafiaCanvasWidget, 5-pass CanvasPainter, InputDispatcher, validate_invariants, and tiny-skia headless offscreen verifier.
tokensTheme, Keymap & Preference TokensData-driven theme, color, metric, cursor, keymap (GrafiaKeymap), and preference (GrafiaPreferences) tokens (Light, Dark, and System appearance modes).

§7. Verification & Development Commands

# Launch the interactive desktop vector canvas demo:
cargo run --example vector_canvas_demo

# Run the full test suite (unit, integration, property-based & headless visual parity):
cargo test

# Run architectural & clean-room guardrails:
cargo test --test architecture_guard_tests

# Run rustdoc doctests & verify documentation links:
cargo test --doc
cargo doc --no-deps

# Run strict static analysis (zero warnings):
cargo clippy --all-targets -- -D warnings

§License

Licensed under either of:

at your option.

Re-exports§

pub use adapters::AnnotationDragMode;
pub use adapters::BBoxDragState;
pub use adapters::CanvasTool;
pub use adapters::CanvasViewMode;
pub use adapters::DragSessionTransients;
pub use adapters::DrawingToolState;
pub use adapters::GradientDragState;
pub use adapters::GrafiaCanvasResponse;
pub use adapters::GrafiaCanvasState;
pub use adapters::GrafiaCanvasWidget;
pub use adapters::GuideDragState;
pub use adapters::KnifeDragState;
pub use adapters::MeasurementDragState;
pub use adapters::PenInteractionTransients;
pub use adapters::PencilDragState;
pub use adapters::PixelDragState;
pub use adapters::PrimitiveDragState;
pub use adapters::TextInteractionTransients;
pub use core::add_extremes_to_contours;
pub use core::add_inflection_points_to_contours;
pub use core::align_collinear_opposite;
pub use core::align_selected_nodes;
pub use core::apply_gradient_handle_drag;
pub use core::apply_gradient_spread;
pub use core::bresenham_pixel_cells;
pub use core::build_circle_contour_nodes;
pub use core::build_rectangle_contour_nodes;
pub use core::close_open_contours_in_layer;
pub use core::collect_reference_frame_snap_lines;
pub use core::compute_glyph_tsb_and_bsb;
pub use core::compute_hoi_overlay_geometry;
pub use core::compute_knife_intersections;
pub use core::compute_layer_extra_nodes;
pub use core::compute_layer_measurement_labels;
pub use core::compute_measurement_ray_intersections;
pub use core::compute_measurement_typographic_angle_deg;
pub use core::compute_pixel_preview_cells_upm;
pub use core::compute_primitive_rect_upm;
pub use core::compute_selection_bounds;
pub use core::compute_signed_area;
pub use core::compute_subdivision_grid_lines_upm;
pub use core::compute_vertical_kerning_indicator_quads;
pub use core::connect_selected_open_endpoints_in_contours;
pub use core::constrain_knife_endpoint;
pub use core::contour_signed_area;
pub use core::contour_to_bezpath_with_splines;
pub use core::correct_path_direction_layer;
pub use core::cut_open_delete_nodes;
pub use core::evaluate_color_layer_paint_at_upm;
pub use core::evaluate_euler_spiro_chain_to_cubics;
pub use core::evaluate_hobby_chain_to_cubics;
pub use core::extract_clipboard_contours;
pub use core::extract_segments;
pub use core::find_contour_node_upm;
pub use core::find_duplicate_warning_nodes;
pub use core::find_pixel_cell_contour_index;
pub use core::fit_freehand_contour_nodes;
pub use core::format_measurement_value;
pub use core::gradient_control_segment_upm;
pub use core::gradient_stop_position_upm;
pub use core::gradient_stops_slice;
pub use core::grid_fit_contour_nodes;
pub use core::grid_fit_coord_upm;
pub use core::heal_delete_nodes;
pub use core::hit_test_annotation_body;
pub use core::hit_test_annotation_handle;
pub use core::hit_test_bbox_knobs;
pub use core::hit_test_gradient_handle;
pub use core::hit_test_segments;
pub use core::hobby_velocity_rho;
pub use core::intersect_contours;
pub use core::knife_add_nodes_in_layer;
pub use core::knife_cut_paths_in_layer;
pub use core::make_node_first_or_reverse_open;
pub use core::next_zoom_step;
pub use core::paste_clipboard_into_contours;
pub use core::pixel_cell_bounds_upm;
pub use core::point_in_polygon;
pub use core::porter_duff_src_over;
pub use core::prev_zoom_step;
pub use core::project_point_to_background_contours;
pub use core::project_pointer_onto_smart_handle;
pub use core::recompute_vertical_slot_origins;
pub use core::reference_frame_center_upm;
pub use core::remove_overlap_in_contours;
pub use core::resolve_vertical_caret_index_at_upm;
pub use core::resolve_vertical_slot_at_upm;
pub use core::sample_gradient_stops;
pub use core::select_nodes_in_lasso_polygon;
pub use core::simplify_polyline_rdp;
pub use core::smart_handle_track_endpoints_upm;
pub use core::smart_handle_upm_position;
pub use core::snap_to_pixel_cell;
pub use core::snap_vector_45_degrees;
pub use core::split_contour_segment;
pub use core::subtract_contours;
pub use core::tidy_up_contours;
pub use core::trace_background_image;
pub use core::truetype_upm_per_px;
pub use core::Affine2D;
pub use core::AnchorId;
pub use core::AnchorSelectionInfo;
pub use core::AnnotationId;
pub use core::AnnotationKind;
pub use core::AnnotationSubTool;
pub use core::AutoTraceConfig;
pub use core::AutoTraceThresholdMode;
pub use core::BBoxAction;
pub use core::BackgroundImageInfo;
pub use core::BackgroundImageMutation;
pub use core::CanvasAnchor;
pub use core::CanvasAnnotation;
pub use core::CanvasBackgroundImage;
pub use core::CanvasClipboard;
pub use core::CanvasColorSublayer;
pub use core::CanvasComponent;
pub use core::CanvasDocumentScene;
pub use core::CanvasGuideSet;
pub use core::CanvasHintingAndHoiScene;
pub use core::CanvasHostRequest;
pub use core::CanvasLayerAttachments;
pub use core::CanvasSmartHandle;
pub use core::CanvasTextStream;
pub use core::ClipboardContour;
pub use core::ColorLayerPaint;
pub use core::ColorSublayerMutation;
pub use core::CompanionMasterLayer;
pub use core::ComponentId;
pub use core::ComponentSelectionInfo;
pub use core::ContourId;
pub use core::ContourSegment;
pub use core::ContourStrokeStyle;
pub use core::CustomReferenceFrame;
pub use core::DuplicateWarningKind;
pub use core::ExtraNodeKey;
pub use core::FitCurveConfig;
pub use core::FontPoint;
pub use core::FontUnit;
pub use core::GhostMarkPath;
pub use core::Glyph;
pub use core::GlyphBaseInfo;
pub use core::GlyphContour;
pub use core::GlyphHierarchy;
pub use core::GlyphSlot;
pub use core::GradientExtend;
pub use core::GradientHandleKind;
pub use core::GradientSpread;
pub use core::GradientStop;
pub use core::GuideAlignment;
pub use core::GuideInfo;
pub use core::HobbyDirConstraint;
pub use core::HobbyNodeInfo;
pub use core::HoiCubicLayerSet;
pub use core::HoiDiamondRole;
pub use core::HoiOverlayGeometry;
pub use core::HoiSiblingContours;
pub use core::KerningDelta;
pub use core::KerningIndicatorQuad;
pub use core::LayerPathOp;
pub use core::LineCapStyle;
pub use core::LineJoinStyle;
pub use core::MasterCompatibilityReport;
pub use core::MeasurementLayerLabels;
pub use core::MetricsAxis;
pub use core::MetricsOrigin;
pub use core::MultiNodeInfo;
pub use core::Node;
pub use core::NodeId;
pub use core::NodeType;
pub use core::PostScriptHint;
pub use core::PostScriptHintAxis;
pub use core::PostScriptHintMutation;
pub use core::PrimitiveSubTool;
pub use core::RectUpm;
pub use core::ReferenceBandLine;
pub use core::ScreenDp;
pub use core::ScreenPoint;
pub use core::SegmentHit;
pub use core::SelectionBounds;
pub use core::SelectionInfo;
pub use core::SelectionInfoAction;
pub use core::Shape;
pub use core::ShapeBooleanRole;
pub use core::ShapeId;
pub use core::SingleOffCurveInfo;
pub use core::SingleOnCurveInfo;
pub use core::SlotScanlineMeasurement;
pub use core::SnapTargetKind;
pub use core::SnapTargetMask;
pub use core::SolvedSplineSegment;
pub use core::SpacingDelta;
pub use core::StrokePosition;
pub use core::TextStreamEditKind;
pub use core::TextStreamEditRequest;
pub use core::ToolDialogRequest;
pub use core::TouchInteractionState;
pub use core::TransformGridAnchor;
pub use core::TransformOriginSpec;
pub use core::TrueTypeInstructionKind;
pub use core::TrueTypeInstructionMutation;
pub use core::TrueTypeRoundingGrid;
pub use core::TrueTypeVisualInstruction;
pub use core::ViewportTransform;
pub use core::VirtualExtraNode;
pub use core::WritingDirection;
pub use core::MAX_INTERACTIVE_DRAG_PIXMAP_DIM;
pub use interaction::CanvasGesture;
pub use interaction::CommandHistory;
pub use interaction::GlyphSnapshot;
pub use interaction::Modifiers;
pub use interaction::PenToolState;
pub use interaction::SelectToolState;
pub use interaction::SnapshotHintingAndHoiState;
pub use interaction::SnapshotLayerAttachments;
pub use locator::ShapeLocatorRenderer;
pub use locator::ShapeLocatorStyle;
pub use locator::ShapeLocatorWidget;
pub use render::compute_ruler_tick_steps_upm;
pub use render::render_colored_thumbnail;
pub use render::render_preview_strip_rgba;
pub use render::tessellate_contours_even_odd;
pub use render::tessellate_contours_nonzero;
pub use render::tessellate_glyph_contours_nonzero;
pub use render::GrafiaPreviewWidget;
pub use render::PreviewFilledProjection;
pub use render::PreviewPanelConfig;
pub use render::PreviewRenderConfig;
pub use render::PreviewStripCache;
pub use render::ProjectedNode;
pub use render::ReferenceFramePalette;
pub use render::RulerTickRangeUpm;
pub use render::ShapeThumbnailProjection;
pub use snapping::calculate_guide_intersections;
pub use snapping::classify_node_alignment;
pub use snapping::normalize_guide_angle;
pub use snapping::smart_two_node_guide_geometry;
pub use snapping::ActiveSnapper;
pub use snapping::AlignmentBadgeMode;
pub use snapping::AlignmentZone;
pub use snapping::GlyphMetrics;
pub use snapping::Guide;
pub use snapping::GuideHitKind;
pub use snapping::GuideId;
pub use snapping::GuideMeasurementRay;
pub use snapping::GuideMeasurementSegment;
pub use snapping::GuideThickness;
pub use snapping::SelectedGuideRef;
pub use snapping::SnapEngine;
pub use snapping::SnapGuideContext;
pub use snapping::SnapResult;
pub use tokens::AppearanceMode;
pub use tokens::CanvasActionId;
pub use tokens::EditCanvasTokens;
pub use tokens::GrafiaKeymap;
pub use tokens::GrafiaPreferences;
pub use tokens::GrafiaTheme;
pub use tokens::KeyChord;
pub use tokens::OffCurveHandleShape;
pub use tokens::RgbaColorToken;
pub use tokens::ANCHOR_DIAMOND_RADIUS_DP;
pub use tokens::ANCHOR_DIAMOND_SELECTED_RADIUS_DP;
pub use tokens::ANCHOR_HIT_RADIUS_DP;
pub use tokens::BACKGROUND_LAYER_STROKE_DARK;
pub use tokens::BACKGROUND_LAYER_STROKE_LIGHT;
pub use tokens::BACKGROUND_STROKE_WIDTH_DP;
pub use tokens::FIT_CURVE_DEFAULT_MAX_RATIO;
pub use tokens::FIT_CURVE_DEFAULT_MIN_RATIO;
pub use tokens::FIT_CURVE_MAX_INTERSECTION_CHORD_MULTIPLE;
pub use tokens::KERNING_INCREMENT_HIGH_UPM;
pub use tokens::KERNING_INCREMENT_LOW_UPM;
pub use tokens::KERNING_NEGATIVE_FILL_DARK;
pub use tokens::KERNING_NEGATIVE_FILL_LIGHT;
pub use tokens::KERNING_POSITIVE_FILL_DARK;
pub use tokens::KERNING_POSITIVE_FILL_LIGHT;
pub use tokens::PASSIVE_GLYPH_FILL_DARK;
pub use tokens::PASSIVE_GLYPH_FILL_LIGHT;
pub use tokens::PREVIEW_BG_INVERTED_DARK;
pub use tokens::PREVIEW_BG_INVERTED_LIGHT;
pub use tokens::PREVIEW_BG_NORMAL_DARK;
pub use tokens::PREVIEW_BG_NORMAL_LIGHT;
pub use tokens::PREVIEW_BLUR_ACTIVE_THRESHOLD_PX;
pub use tokens::PREVIEW_BLUR_DEFAULT_RADIUS_PX;
pub use tokens::PREVIEW_BLUR_MAX_RADIUS_PX;
pub use tokens::PREVIEW_BLUR_MIN_RADIUS_PX;
pub use tokens::PREVIEW_BOTH_EXTRA_SPACE_SCALE;
pub use tokens::PREVIEW_DEFAULT_EXTRA_SPACING;
pub use tokens::PREVIEW_FG_INVERTED_DARK;
pub use tokens::PREVIEW_FG_INVERTED_LIGHT;
pub use tokens::PREVIEW_FG_NORMAL_DARK;
pub use tokens::PREVIEW_FG_NORMAL_LIGHT;
pub use tokens::PREVIEW_ONE_EXTRA_SPACE_SCALE;
pub use tokens::RULER_BG_FILL_DARK;
pub use tokens::RULER_BG_FILL_LIGHT;
pub use tokens::RULER_BORDER_STROKE_DARK;
pub use tokens::RULER_BORDER_STROKE_LIGHT;
pub use tokens::RULER_HAIRLINE_COLOR_DARK;
pub use tokens::RULER_HAIRLINE_COLOR_LIGHT;
pub use tokens::RULER_THICKNESS_DP;
pub use tokens::RULER_TICK_COLOR_DARK;
pub use tokens::RULER_TICK_COLOR_LIGHT;
pub use tokens::SPACING_INCREMENT_HIGH_UPM;
pub use tokens::SPACING_INCREMENT_LOW_UPM;
pub use tokens::TEXT_CARET_COLOR_DARK;
pub use tokens::TEXT_CARET_COLOR_LIGHT;
pub use tokens::TEXT_MEASUREMENT_KNOB_FILL_DARK;
pub use tokens::TEXT_MEASUREMENT_KNOB_FILL_LIGHT;
pub use tokens::TEXT_MEASUREMENT_LINE_COLOR_DARK;
pub use tokens::TEXT_MEASUREMENT_LINE_COLOR_LIGHT;
pub use tokens::TEXT_MEASUREMENT_LINE_DEFAULT_Y_UPM;
pub use tokens::TEXT_METRICS_NUMBER_COLOR_DARK;
pub use tokens::TEXT_METRICS_NUMBER_COLOR_LIGHT;
pub use tokens::TEXT_MODE_NUMBERS_THRESHOLD_DEFAULT;
pub use tokens::TEXT_SELECTION_DRAG_THRESHOLD_DP;
pub use tokens::TEXT_SELECTION_FILL_DARK;
pub use tokens::TEXT_SELECTION_FILL_LIGHT;

Modules§

adapters
Hexagonal Host-Port (“Plug-and-Play”) Architecture (grafia::adapters)
core
Core Mathematical, Spline, Topology & Auto-Trace Engine (grafia::core)
interaction
Deterministic Tool State Machines & Atomic Undo/Redo History (grafia::interaction)
locator
ShapeLocator micro-viewport vector minimap (SPEC-002 Deel I §5.2, TC-LOCATOR-01).
render
5-Pass Rendering Pipeline, GPU Tessellation & Zero-CPU Idle Caching (grafia::render)
snapping
Magnetic Snapping, Guides, Alignment Zones & Reference Frames (grafia::snapping)
tokens
Layout and rendering tokens loaded from JSON databases.