rpdfium-doc 7676.6.2

Document-level features for rpdfium
Documentation
// Derived from PDFium's cpvt_lineinfo.h
// Original: Copyright 2014 The PDFium Authors
// Licensed under BSD-3-Clause / Apache-2.0
// See pdfium-upstream/LICENSE for the original license.

//! Line info — line statistics for the iterator API (`CPVT_LineInfo`).
//!
//! Distinct from `Line` (which holds layout-engine internal state).
//! `LineInfo` is the view exposed to callers iterating over laid-out lines.
//!
//! In rpdfium this is consolidated into `Line`; this type is provided for
//! upstream 1:1 file mapping.

/// Line statistics exposed to callers of the variable text iterator.
///
/// Corresponds to upstream `CPVT_LineInfo`.  In rpdfium, the same
/// information is carried in [`super::vt_line::Line`].
#[derive(Debug, Clone, Default)]
pub struct LineInfo {
    /// Total number of words (characters) on this line.
    pub total_words: usize,
    /// Global word index of the first word on this line.
    pub word_begin: usize,
    /// Global word index of the last word on this line (inclusive).
    pub word_end: usize,
    /// Vertical position of the line.
    pub line_y: f32,
    /// Line height (ascent − descent).
    pub line_height: f32,
}