Skip to main content

rpdfium_doc/variable_text/
vt_section.rs

1// Derived from PDFium's cpvt_section.h
2// Original: Copyright 2014 The PDFium Authors
3// Licensed under BSD-3-Clause / Apache-2.0
4// See pdfium-upstream/LICENSE for the original license.
5
6//! Section — a paragraph of laid-out text (`CPVT_Section`).
7//!
8//! A section is a run of text delimited by paragraph breaks. Each section
9//! holds its words (characters) and the lines produced by word-wrap.
10
11use super::vt_line::Line;
12use super::vt_word_info::WordInfo;
13
14/// A section of text (separated by paragraph breaks).
15///
16/// Corresponds to upstream `CPVT_Section`.
17#[derive(Debug, Clone)]
18pub struct Section {
19    /// Characters in this section.
20    pub words: Vec<WordInfo>,
21    /// Lines after layout.
22    pub lines: Vec<Line>,
23    /// Bounding rect [left, bottom, right, top] of this section.
24    pub rect: [f32; 4],
25}