rpdfium-doc 7676.6.2

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

//! Word — iterator-level character record (`CPVT_Word`).
//!
//! Distinct from `WordInfo` (layout-engine internal). `Word` is the view
//! exposed to callers iterating over laid-out characters.
//!
//! In rpdfium this overlaps with `WordInfo`; this type is provided for
//! upstream 1:1 file mapping.

/// A single word (character) at the iterator level.
///
/// Corresponds to upstream `CPVT_Word`.  In rpdfium the same data is
/// carried in [`super::vt_word_info::WordInfo`].
#[derive(Debug, Clone)]
pub struct Word {
    /// The Unicode character value (UTF-16 code unit).
    pub character: u16,
    /// Font index within the font provider.
    pub font_index: usize,
    /// X position of the character within the line.
    pub word_x: f32,
    /// Y position (baseline) of the character.
    pub word_y: f32,
    /// Advance width of the character.
    pub word_width: f32,
    /// Height of the character (ascent − descent).
    pub word_height: f32,
}