pub struct ListBoxAppearance {
pub font: Font,
pub font_size: f64,
pub text_color: Color,
pub selection_color: Color,
pub options: Vec<String>,
pub selected: Vec<usize>,
pub item_height: f64,
}Expand description
Appearance generator for ListBox fields
Fields§
§font: FontFont for text
font_size: f64Font size
text_color: ColorText color
selection_color: ColorBackground color for selected items
options: Vec<String>Options to display
selected: Vec<usize>Selected indices
item_height: f64Item height
Implementations§
Source§impl ListBoxAppearance
impl ListBoxAppearance
Sourcepub fn generate_appearance_with_font(
&self,
widget: &Widget,
_value: Option<&str>,
_state: AppearanceState,
custom_font: Option<&Font>,
) -> Result<FieldAppearanceResult>
pub fn generate_appearance_with_font( &self, widget: &Widget, _value: Option<&str>, _state: AppearanceState, custom_font: Option<&Font>, ) -> Result<FieldAppearanceResult>
Type0/CID-aware appearance generator for ListBox fields.
Mirrors TextFieldAppearance::generate_appearance_with_font and
ComboBoxAppearance::generate_appearance_with_font: dispatches on
self.font.is_custom() × the optional custom_font parameter to emit
hex-CID Tj for Type0/CID fonts, an explicit error when the font name
is custom but the resolved font object is missing, and the legacy
WinAnsi-strict path for built-in Type1 fonts.
The /Resources/Font/<name> entry follows the same pattern: a Type0
placeholder when is_custom() (rewritten by the writer to an indirect
reference at serialisation time, see
writer::pdf_writer::rewrite_ap_stream_font_resources), and an inline
Type1 dict otherwise. Used in support of issue #212.
Trait Implementations§
Source§impl AppearanceGenerator for ListBoxAppearance
impl AppearanceGenerator for ListBoxAppearance
Source§fn generate_appearance(
&self,
widget: &Widget,
value: Option<&str>,
state: AppearanceState,
) -> Result<AppearanceStream>
fn generate_appearance( &self, widget: &Widget, value: Option<&str>, state: AppearanceState, ) -> Result<AppearanceStream>
Source§impl Clone for ListBoxAppearance
impl Clone for ListBoxAppearance
Source§fn clone(&self) -> ListBoxAppearance
fn clone(&self) -> ListBoxAppearance
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more