This commit is contained in:
Max 2024-08-20 15:12:12 +00:00 committed by GitHub
parent 986d624b3a
commit cefca7a7d8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
15 changed files with 29 additions and 29 deletions

View File

@ -223,7 +223,7 @@ fn shading_function(
function
}
/// Writes an expontential function that expresses a single segment (between two
/// Writes an exponential function that expresses a single segment (between two
/// stops) of a gradient.
fn single_gradient(
chunk: &mut PdfChunk,

View File

@ -1443,7 +1443,7 @@ pub enum BinOp {
NotIn,
/// The add-assign operator: `+=`.
AddAssign,
/// The subtract-assign oeprator: `-=`.
/// The subtract-assign operator: `-=`.
SubAssign,
/// The multiply-assign operator: `*=`.
MulAssign,

View File

@ -824,7 +824,7 @@ pub enum Side {
After,
}
/// Access to leafs.
/// Access to leaves.
impl<'a> LinkedNode<'a> {
/// Get the rightmost non-trivia leaf before this node.
pub fn prev_leaf(&self) -> Option<Self> {

View File

@ -16,8 +16,8 @@ use siphasher::sip128::{Hasher128, SipHasher13};
/// Note that for a value `v` of type `T`, `hash(v)` is not necessarily equal to
/// `hash(LazyHash::new(v))`. Writing the precomputed hash into a hasher's
/// state produces different output than writing the value's parts directly.
/// However, that seldomly matters as you are typically either dealing with
/// values of type `T` or with values of type `LazyHash<T>`, not a mix of both.
/// However, that seldom matters as you are typically either dealing with values
/// of type `T` or with values of type `LazyHash<T>`, not a mix of both.
///
/// # Equality
/// Because Typst uses high-quality 128 bit hashes in all places, the risk of a

View File

@ -95,7 +95,7 @@ use crate::introspection::{Introspector, Location};
/// that layer upfront and then start forking out. The final remaining
/// question is how we can compactly encode this information: For this, as
/// always, we use hashing! We incorporate the ID information from each layer
/// into a single hash and thanks to the collision resistence of 128-bit
/// into a single hash and thanks to the collision resistance of 128-bit
/// SipHash, we get almost guaranteed unique locations. We don't even store
/// the full layer information at all, but rather hash _hierarchically:_ Let
/// `k_x` be our local per-layer ID for layer `x` and `h_x` be the full

View File

@ -45,7 +45,7 @@ use crate::visualize::{Paint, Stroke};
/// intended for presentational and layout purposes, while the
/// [`{table}`]($table) element is intended for, in broad terms, presenting
/// multiple related data points. In the future, Typst will annotate its output
/// such that screenreaders will annouce content in `table` as tabular while a
/// such that screenreaders will announce content in `table` as tabular while a
/// grid's content will be announced no different than multiple content blocks
/// in the document flow. Set and show rules on one of these elements do not
/// affect the other.

View File

@ -256,7 +256,7 @@ where
}
}
/// Collects / reshapes all items for the given `subrange` with continous
/// Collects / reshapes all items for the given `subrange` with continuous
/// direction.
fn collect_range<'a>(
engine: &Engine,

View File

@ -348,7 +348,7 @@ fn linebreak_optimized_bounded<'a>(
/// Runs the normal Knuth-Plass algorithm, but instead of building proper lines
/// (which is costly) to determine costs, it determines approximate costs using
/// cummulative arrays.
/// cumulative arrays.
///
/// This results in a likely good paragraph layouts, for which we then compute
/// the exact cost. This cost is an upper bound for proper optimized
@ -360,7 +360,7 @@ fn linebreak_optimized_approximate(
width: Abs,
metrics: &CostMetrics,
) -> Cost {
// Determine the cummulative estimation metrics.
// Determine the cumulative estimation metrics.
let estimates = Estimates::compute(p);
/// An entry in the dynamic programming table for paragraph optimization.
@ -872,10 +872,10 @@ impl CostMetrics {
/// Allows to get a quick estimate of a metric for a line between two byte
/// positions.
struct Estimates {
widths: CummulativeVec<Abs>,
stretchability: CummulativeVec<Abs>,
shrinkability: CummulativeVec<Abs>,
justifiables: CummulativeVec<usize>,
widths: CumulativeVec<Abs>,
stretchability: CumulativeVec<Abs>,
shrinkability: CumulativeVec<Abs>,
justifiables: CumulativeVec<usize>,
}
impl Estimates {
@ -883,10 +883,10 @@ impl Estimates {
fn compute(p: &Preparation) -> Self {
let cap = p.text.len();
let mut widths = CummulativeVec::with_capacity(cap);
let mut stretchability = CummulativeVec::with_capacity(cap);
let mut shrinkability = CummulativeVec::with_capacity(cap);
let mut justifiables = CummulativeVec::with_capacity(cap);
let mut widths = CumulativeVec::with_capacity(cap);
let mut stretchability = CumulativeVec::with_capacity(cap);
let mut shrinkability = CumulativeVec::with_capacity(cap);
let mut justifiables = CumulativeVec::with_capacity(cap);
for (range, item) in p.items.iter() {
if let Item::Text(shaped) = item {
@ -919,12 +919,12 @@ impl Estimates {
}
/// An accumulative array of a metric.
struct CummulativeVec<T> {
struct CumulativeVec<T> {
total: T,
summed: Vec<T>,
}
impl<T> CummulativeVec<T>
impl<T> CumulativeVec<T>
where
T: Default + Copy + Add<Output = T> + Sub<Output = T>,
{

View File

@ -123,7 +123,7 @@ pub struct ParElem {
#[resolve]
pub hanging_indent: Length,
/// Indicates wheter an overflowing line should be shrunk.
/// Indicates whether an overflowing line should be shrunk.
///
/// This property is set to `false` on raw blocks, because shrinking a line
/// could visually break the indentation.

View File

@ -39,9 +39,9 @@ use crate::visualize::{Paint, Stroke};
/// your presentation by arranging unrelated content in a grid. In the former
/// case, a table is the right choice, while in the latter case, a grid is more
/// appropriate. Furthermore, Typst will annotate its output in the future such
/// that screenreaders will annouce content in `table` as tabular while a grid's
/// content will be announced no different than multiple content blocks in the
/// document flow.
/// that screenreaders will announce content in `table` as tabular while a
/// grid's content will be announced no different than multiple content blocks
/// in the document flow.
///
/// Note that, to override a particular cell's properties or apply show rules on
/// table cells, you can use the [`table.cell`]($table.cell) element. See its

View File

@ -128,7 +128,7 @@ impl Show for Packed<SuperElem> {
}
/// Find and transform the text contained in `content` to the given script kind
/// if and only if it only consists of `Text`, `Space`, and `Empty` leafs.
/// if and only if it only consists of `Text`, `Space`, and `Empty` leaves.
fn search_text(content: &Content, sub: bool) -> Option<EcoString> {
if content.is::<SpaceElem>() {
Some(' '.into())

View File

@ -89,7 +89,7 @@ impl<'a> Logger<'a> {
let Self { selected, passed, failed, skipped, .. } = *self;
eprintln!("{passed} passed, {failed} failed, {skipped} skipped");
assert_eq!(selected, passed + failed, "not all tests were executed succesfully");
assert_eq!(selected, passed + failed, "not all tests were executed successfully");
if self.mismatched_image {
eprintln!(" pass the --update flag to update the reference images");

View File

@ -24,7 +24,7 @@
--- measure-counter-width ---
// Measure a counter. Tests that the introspector-assisted location assignment
// is able to take `here()` from the context into account to find the closest
// matching element instaed of any single one. Crucially, we need to reuse
// matching element instead of any single one. Crucially, we need to reuse
// the same `context c.display()` to get the same span, hence `it`.
#let f(it) = context [
Is #measure(it).width wide: #it \

View File

@ -47,7 +47,7 @@ $ A = 1 $ <eq2>
#set ref(supplement: none)
@fig1, @fig2, @eq1, @eq2
--- ref-ambigious ---
--- ref-ambiguous ---
// Test ambiguous reference.
= Introduction <arrgh>

View File

@ -24,7 +24,7 @@ class TestHelper {
// The current zoom scale.
scale = 1.0;
// The extention's status bar item.
// The extension's status bar item.
statusItem: vscode.StatusBarItem;
// The active message of the status item.