Skip to main content

rpdfium_doc/variable_text/
vt_line.rs

1// Derived from PDFium's cpvt_line.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//! Line — a laid-out line of text within a section (`CPVT_Line`).
7//!
8//! Stores the word range and positional metrics for one wrapped line.
9
10/// A laid-out line of text within a section.
11///
12/// Corresponds to upstream `CPVT_Line`.
13#[derive(Debug, Clone)]
14pub struct Line {
15    /// Index of the first word in this line within the section's words.
16    pub word_start: usize,
17    /// Number of words in this line.
18    pub word_count: usize,
19    /// X offset of the line (after alignment).
20    pub x: f32,
21    /// Y position of the line baseline.
22    pub y: f32,
23    /// Width of the text content on this line.
24    pub width: f32,
25    /// Ascent of the tallest character on this line.
26    pub ascent: f32,
27    /// Descent of the deepest character on this line.
28    pub descent: f32,
29}