|
4 | 4 | //! each with different performance characteristics and trade-offs: |
5 | 5 | //! |
6 | 6 | //! - [`WebGl2Backend`]: GPU-accelerated rendering powered by [beamterm][beamterm]. Uses prebuilt |
7 | | -//! font atlases. Best performance, capable of 60fps on large terminals (300x100+). |
| 7 | +//! or runtime generated font atlases. Best performance, capable of 60fps on large terminals. |
8 | 8 | //! |
9 | 9 | //! - [`CanvasBackend`]: Canvas 2D API with full Unicode support via browser font rendering. |
10 | | -//! Good fallback when WebGL2 isn't available or when dynamic character support is required. |
11 | | -//! Does not support hyperlinks or text selection, but can render dynamic Unicode/emoji. |
| 10 | +//! Good fallback when WebGL2. Does not support hyperlinks or text selection, but can render |
| 11 | +//! dynamic Unicode/emoji. |
12 | 12 | //! |
13 | 13 | //! - [`DomBackend`]: Renders cells as HTML elements. Most compatible and accessible, |
14 | 14 | //! supports hyperlinks, but slowest for large terminals. |
|
17 | 17 | //! |
18 | 18 | //! ## Backend Comparison |
19 | 19 | //! |
20 | | -//! | Feature | DomBackend | CanvasBackend | WebGl2Backend | |
21 | | -//! |------------------------------|------------|---------------|------------------| |
22 | | -//! | **60fps on large terminals** | ✗ | ✗ | ✓ | |
23 | | -//! | **Memory Usage** | Highest | Medium | Lowest | |
24 | | -//! | **Hyperlinks** | ✓ | ✗ | ✓ | |
25 | | -//! | **Text Selection** | ✓ | ✗ | ✓ | |
26 | | -//! | **Accessibility** | ✓ | Limited | Limited | |
27 | | -//! | **Unicode/Emoji Support** | Full | Full | Limited to atlas | |
28 | | -//! | **Dynamic Characters** | ✓ | ✓ | ✗ | |
29 | | -//! | **Font Variants** | ✓ | Regular only | ✓ | |
30 | | -//! | **Underline** | ✓ | ✗ | ✓ | |
31 | | -//! | **Strikethrough** | ✓ | ✗ | ✓ | |
32 | | -//! | **Browser Support** | All | All | Modern (2017+) | |
| 20 | +//! | Feature | DomBackend | CanvasBackend | WebGl2Backend | |
| 21 | +//! |------------------------------|------------|---------------|----------------| |
| 22 | +//! | **60fps on large terminals** | ✗ | ✗ | ✓ | |
| 23 | +//! | **Memory Usage** | Highest | Medium | Lowest | |
| 24 | +//! | **Hyperlinks** | ✓ | ✗ | ✓ | |
| 25 | +//! | **Text Selection** | ✓ | ✗ | ✓ | |
| 26 | +//! | **Accessibility** | ✓ | Limited | Limited | |
| 27 | +//! | **Unicode/Emoji Support** | Full | Full | Full¹ | |
| 28 | +//! | **Dynamic Characters** | ✓ | ✓ | ✓¹ | |
| 29 | +//! | **Font Variants** | ✓ | Regular only | ✓ | |
| 30 | +//! | **Underline** | ✓ | ✗ | ✓ | |
| 31 | +//! | **Strikethrough** | ✓ | ✗ | ✓ | |
| 32 | +//! | **Browser Support** | All | All | Modern (2017+) | |
| 33 | +//! |
| 34 | +//! ¹: The [dynamic font atlas](webgl2::WebGl2BackendOptions::dynamic_font_atlas) rasterizes |
| 35 | +//! glyphs on demand with full Unicode/emoji and font variant support. The |
| 36 | +//! [static font atlas](webgl2::WebGl2BackendOptions::font_atlas) is limited to glyphs |
| 37 | +//! included at atlas build time. |
33 | 38 | //! |
34 | 39 | //! ## Choosing a Backend |
35 | 40 | //! |
36 | 41 | //! - **WebGl2Backend**: Preferred for most applications - consumes the least amount of resources |
37 | | -//! - **CanvasBackend**: When you need dynamic Unicode/emoji or must support non-WebGL2 browsers |
| 42 | +//! - **CanvasBackend**: When you must support non-WebGL2 browsers |
38 | 43 | //! - **DomBackend**: When you need better accessibility or CSS styling |
39 | 44 |
|
40 | 45 | /// Canvas backend. |
|
0 commit comments