Module pdf_dope_card

Module pdf_dope_card 

Source
Expand description

PDF Dope Card Generation Module

Generates printable dope cards in Glenn’s proven field-ready format. Format: Two-column layout with Range (yd or m) and Drop/Wind/Lead in MIL or MOA (selected via DopeCardConfig::unit_label; values pre-converted by the caller) Color coding: Black=Range, Red=Drop, Green=Wind, Blue=Lead Row striping for improved readability.

0.33.0 decision-support Plan B Task 10: moved from a ballistics-binary-private module (mod pdf_dope_card; in main.rs) into this library behind the pdf feature, and rewritten to consume &[crate::card::CardRow] instead of this module’s own DopeCardRow { range_yd: u32, .. } – the u32-yards field couldn’t express the non-integer ranges Task 11’s adaptive card engine (crate::card) produces. The caller now states the row range’s unit explicitly via RangeUnit; see its doc comment.

Structs§

DopeCardConfig
Configuration for the dope card PDF

Enums§

FontSizePreset
Preset font size profiles for dope cards
RangeUnit
Which unit CardRow::range is expressed in for this card. Selects only the Range column’s sub-header text (“Yd” / “M”) – row values are never converted here, same “the caller already converted it” convention CardRow itself documents.

Constants§

FONT_SCALE_RANGE
The font_scale band generate_dope_card_pdf honours; anything outside it is clamped into it (see dope_card_rows_per_page, which clamps identically so a page count and the document it describes cannot disagree).
UNPRINTABLE_SUBSTITUTE
What a character the card font cannot draw is printed as.

Functions§

calculate_density_altitude
Calculate density altitude from environmental conditions
dope_card_page_count
Pages generate_dope_card_pdf emits for row_count rows at font_scale.
dope_card_rows_per_page
Data rows the two-column table fits on one page at font_scale.
generate_dope_card_pdf
Generate a dope card PDF matching Glenn’s format with row striping.
unprintable_chars
The distinct characters of text this card’s font has no glyph for, in order of first use; empty when every character prints.