pub struct PcbText {Show 19 fields
pub base: PcbRectangularBase,
pub mirrored: bool,
pub text_kind: PcbTextKind,
pub stroke_font: PcbTextStrokeFont,
pub stroke_width: Coord,
pub font_bold: bool,
pub font_italic: bool,
pub font_name: String,
pub barcode_lr_margin: Coord,
pub barcode_tb_margin: Coord,
pub font_inverted: bool,
pub font_inverted_border: Coord,
pub font_inverted_rect: bool,
pub font_inverted_rect_width: Coord,
pub font_inverted_rect_height: Coord,
pub font_inverted_rect_justification: PcbTextJustification,
pub font_inverted_rect_text_offset: Coord,
pub text: String,
pub wide_strings_index: i32,
}Expand description
PCB Text primitive.
Fields§
§base: PcbRectangularBaseBase rectangular fields.
mirrored: boolWhether the text is mirrored.
text_kind: PcbTextKindText kind (Stroke, TrueType, BarCode).
stroke_font: PcbTextStrokeFontStroke font type.
stroke_width: CoordStroke width.
font_bold: boolFont is bold.
font_italic: boolFont is italic.
font_name: StringTrueType font name.
barcode_lr_margin: CoordBarcode left/right margin.
barcode_tb_margin: CoordBarcode top/bottom margin.
font_inverted: boolFont is inverted.
font_inverted_border: CoordInverted border width.
font_inverted_rect: boolInverted rectangle mode.
font_inverted_rect_width: CoordInverted rectangle width.
font_inverted_rect_height: CoordInverted rectangle height.
font_inverted_rect_justification: PcbTextJustificationInverted rectangle justification.
font_inverted_rect_text_offset: CoordInverted rectangle text offset.
text: StringThe actual text content.
wide_strings_index: i32Index into wide strings array (for Unicode text).
Implementations§
Source§impl PcbText
impl PcbText
Sourcepub fn new(
x: f64,
y: f64,
text: &str,
height: f64,
stroke_width: f64,
rotation: f64,
mirrored: bool,
layer: Layer,
) -> Self
pub fn new( x: f64, y: f64, text: &str, height: f64, stroke_width: f64, rotation: f64, mirrored: bool, layer: Layer, ) -> Self
Create a new text element.
§Arguments
x- X position in millimetersy- Y position in millimeterstext- Text contentheight- Text height in millimetersstroke_width- Stroke width in millimetersrotation- Rotation angle in degreesmirrored- Whether the text is mirroredlayer- The layer to place the text on
Sourcepub fn calculate_bounds(&self) -> CoordRect
pub fn calculate_bounds(&self) -> CoordRect
Calculate the bounding rectangle.
Trait Implementations§
Source§impl DumpTree for PcbText
impl DumpTree for PcbText
Source§fn dump(&self, tree: &mut TreeBuilder)
fn dump(&self, tree: &mut TreeBuilder)
Dump this item to the tree builder.
Source§fn dump_to_string(&self) -> String
fn dump_to_string(&self) -> String
Convenience method to dump to a string.
Source§fn dump_to_string_with_options(&self, options: DumpOptions) -> String
fn dump_to_string_with_options(&self, options: DumpOptions) -> String
Convenience method to dump to a string with options.
Source§impl FromBinary for PcbText
impl FromBinary for PcbText
Auto Trait Implementations§
impl Freeze for PcbText
impl RefUnwindSafe for PcbText
impl Send for PcbText
impl Sync for PcbText
impl Unpin for PcbText
impl UnwindSafe for PcbText
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more