1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
//! A simple Bevy plugin for generating 3D text meshes from fonts.
//!
//! This plugin provides an easy way to create 3D text geometry in Bevy applications.
//! It handles only mesh generation, leaving materials, lighting, transforms, and
//! rendering to Bevy's standard systems.
//!
//! # Quick Start
//!
//! ```no_run
//! use bevy::prelude::*;
//! use bevy_fontmesh::prelude::*;
//!
//! fn main() {
//! App::new()
//! .add_plugins(DefaultPlugins)
//! .add_plugins(FontMeshPlugin)
//! .add_systems(Startup, setup)
//! .run();
//! }
//!
//! fn setup(
//! mut commands: Commands,
//! asset_server: Res<AssetServer>,
//! mut materials: ResMut<Assets<StandardMaterial>>,
//! ) {
//! commands.spawn(TextMeshBundle {
//! text_mesh: TextMesh {
//! text: "Hello!".to_string(),
//! font: asset_server.load("fonts/font.ttf"),
//! ..default()
//! },
//! material: MeshMaterial3d(materials.add(StandardMaterial::default())),
//! ..default()
//! });
//! }
//! ```
//!
//! # Features
//!
//! - Generates 3D mesh geometry from TrueType fonts
//! - Supports multiline text with `\n` line breaks
//! - Configurable text anchoring (9 presets + custom pivot points)
//! - Text justification (left, center, right)
//! - Adjustable extrusion depth and curve subdivision
//! - Automatic mesh regeneration when text or style changes
//!
//! # Font Format Support
//!
//! - TrueType (`.ttf`) fonts are fully supported
//! - OpenType (`.otf`) fonts with TrueType outlines work
//! - OpenType fonts with CFF/PostScript outlines are not supported (ttf-parser limitation)
pub use ;
pub use ;
pub use ;
use FontMeshLoader;
use *;
use ;
/// Plugin that enables 3D text mesh generation from fonts.
///
/// This plugin registers the necessary assets, loaders, and systems to automatically
/// generate 3D mesh geometry from [`TextMesh`] components. Simply add this plugin to
/// your Bevy app and spawn entities with [`TextMeshBundle`].
///
/// # Example
///
/// ```no_run
/// use bevy::prelude::*;
/// use bevy_fontmesh::FontMeshPlugin;
///
/// App::new()
/// .add_plugins(DefaultPlugins)
/// .add_plugins(FontMeshPlugin)
/// .run();
/// ```
///
/// The plugin automatically:
/// - Registers the [`FontMesh`] asset type for loading TTF/OTF fonts
/// - Adds a system that generates meshes when [`TextMesh`] components are added or changed
/// - Enables reflection for [`TextMesh`] components for editor integration
;