#[non_exhaustive]pub enum FitPolicy {
Exact,
AdjustSpacing,
ShrinkToFit,
ReflowInBounds,
ExpandBounds,
}Expand description
What the engine may do when replacement text does not fit (design §4.3).
Implemented: FitPolicy::Exact and FitPolicy::ShrinkToFit. The rest
are reserved and rejected with TextEditError::UnsupportedFitPolicy.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Exact
Same position, font size and spacing; no measurement-based fitting.
AdjustSpacing
Adjust character/word spacing within limits (Phase 2).
ShrinkToFit
Measure the replacement against the space the original occupied and scale the font size down until it fits, to a floor of 50%.
Reports what it did: a shrunk-to-fit diagnostic with the applied
percentage, or shrink-floor-reached when the text still overruns at
the floor — shrinking further would trade one defect for an
unreadable one.
ReflowInBounds
Re-break the replacement onto more lines inside the width the original occupied, keeping the font size — Acrobat’s behaviour when you edit inside a text box, and the natural choice for translations.
Added lines are not pushed away from content below; like Acrobat, no
other object on the page moves. Reported as a reflowed diagnostic.
ExpandBounds
Expand the text box within caller-supplied bounds (Phase 2).
Trait Implementations§
impl Copy for FitPolicy
impl Eq for FitPolicy
impl StructuralPartialEq for FitPolicy
Auto Trait Implementations§
impl Freeze for FitPolicy
impl RefUnwindSafe for FitPolicy
impl Send for FitPolicy
impl Sync for FitPolicy
impl Unpin for FitPolicy
impl UnsafeUnpin for FitPolicy
impl UnwindSafe for FitPolicy
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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> ⓘ
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> ⓘ
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
Source§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
T, using the provided data to resolve any offsets.