mirror of
https://github.com/typst/typst
synced 2025-05-14 17:15:28 +08:00
Fix typos (#4784)
This commit is contained in:
parent
986d624b3a
commit
cefca7a7d8
@ -223,7 +223,7 @@ fn shading_function(
|
|||||||
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.
|
/// stops) of a gradient.
|
||||||
fn single_gradient(
|
fn single_gradient(
|
||||||
chunk: &mut PdfChunk,
|
chunk: &mut PdfChunk,
|
||||||
|
@ -1443,7 +1443,7 @@ pub enum BinOp {
|
|||||||
NotIn,
|
NotIn,
|
||||||
/// The add-assign operator: `+=`.
|
/// The add-assign operator: `+=`.
|
||||||
AddAssign,
|
AddAssign,
|
||||||
/// The subtract-assign oeprator: `-=`.
|
/// The subtract-assign operator: `-=`.
|
||||||
SubAssign,
|
SubAssign,
|
||||||
/// The multiply-assign operator: `*=`.
|
/// The multiply-assign operator: `*=`.
|
||||||
MulAssign,
|
MulAssign,
|
||||||
|
@ -824,7 +824,7 @@ pub enum Side {
|
|||||||
After,
|
After,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Access to leafs.
|
/// Access to leaves.
|
||||||
impl<'a> LinkedNode<'a> {
|
impl<'a> LinkedNode<'a> {
|
||||||
/// Get the rightmost non-trivia leaf before this node.
|
/// Get the rightmost non-trivia leaf before this node.
|
||||||
pub fn prev_leaf(&self) -> Option<Self> {
|
pub fn prev_leaf(&self) -> Option<Self> {
|
||||||
|
@ -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
|
/// 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
|
/// `hash(LazyHash::new(v))`. Writing the precomputed hash into a hasher's
|
||||||
/// state produces different output than writing the value's parts directly.
|
/// state produces different output than writing the value's parts directly.
|
||||||
/// However, that seldomly matters as you are typically either dealing with
|
/// However, that seldom matters as you are typically either dealing with values
|
||||||
/// values of type `T` or with values of type `LazyHash<T>`, not a mix of both.
|
/// of type `T` or with values of type `LazyHash<T>`, not a mix of both.
|
||||||
///
|
///
|
||||||
/// # Equality
|
/// # Equality
|
||||||
/// Because Typst uses high-quality 128 bit hashes in all places, the risk of a
|
/// Because Typst uses high-quality 128 bit hashes in all places, the risk of a
|
||||||
|
@ -95,7 +95,7 @@ use crate::introspection::{Introspector, Location};
|
|||||||
/// that layer upfront and then start forking out. The final remaining
|
/// that layer upfront and then start forking out. The final remaining
|
||||||
/// question is how we can compactly encode this information: For this, as
|
/// question is how we can compactly encode this information: For this, as
|
||||||
/// always, we use hashing! We incorporate the ID information from each layer
|
/// 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
|
/// SipHash, we get almost guaranteed unique locations. We don't even store
|
||||||
/// the full layer information at all, but rather hash _hierarchically:_ Let
|
/// 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
|
/// `k_x` be our local per-layer ID for layer `x` and `h_x` be the full
|
||||||
|
@ -45,7 +45,7 @@ use crate::visualize::{Paint, Stroke};
|
|||||||
/// intended for presentational and layout purposes, while the
|
/// intended for presentational and layout purposes, while the
|
||||||
/// [`{table}`]($table) element is intended for, in broad terms, presenting
|
/// [`{table}`]($table) element is intended for, in broad terms, presenting
|
||||||
/// multiple related data points. In the future, Typst will annotate its output
|
/// 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
|
/// 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
|
/// in the document flow. Set and show rules on one of these elements do not
|
||||||
/// affect the other.
|
/// affect the other.
|
||||||
|
@ -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.
|
/// direction.
|
||||||
fn collect_range<'a>(
|
fn collect_range<'a>(
|
||||||
engine: &Engine,
|
engine: &Engine,
|
||||||
|
@ -348,7 +348,7 @@ fn linebreak_optimized_bounded<'a>(
|
|||||||
|
|
||||||
/// Runs the normal Knuth-Plass algorithm, but instead of building proper lines
|
/// Runs the normal Knuth-Plass algorithm, but instead of building proper lines
|
||||||
/// (which is costly) to determine costs, it determines approximate costs using
|
/// (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
|
/// 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
|
/// the exact cost. This cost is an upper bound for proper optimized
|
||||||
@ -360,7 +360,7 @@ fn linebreak_optimized_approximate(
|
|||||||
width: Abs,
|
width: Abs,
|
||||||
metrics: &CostMetrics,
|
metrics: &CostMetrics,
|
||||||
) -> Cost {
|
) -> Cost {
|
||||||
// Determine the cummulative estimation metrics.
|
// Determine the cumulative estimation metrics.
|
||||||
let estimates = Estimates::compute(p);
|
let estimates = Estimates::compute(p);
|
||||||
|
|
||||||
/// An entry in the dynamic programming table for paragraph optimization.
|
/// 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
|
/// Allows to get a quick estimate of a metric for a line between two byte
|
||||||
/// positions.
|
/// positions.
|
||||||
struct Estimates {
|
struct Estimates {
|
||||||
widths: CummulativeVec<Abs>,
|
widths: CumulativeVec<Abs>,
|
||||||
stretchability: CummulativeVec<Abs>,
|
stretchability: CumulativeVec<Abs>,
|
||||||
shrinkability: CummulativeVec<Abs>,
|
shrinkability: CumulativeVec<Abs>,
|
||||||
justifiables: CummulativeVec<usize>,
|
justifiables: CumulativeVec<usize>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Estimates {
|
impl Estimates {
|
||||||
@ -883,10 +883,10 @@ impl Estimates {
|
|||||||
fn compute(p: &Preparation) -> Self {
|
fn compute(p: &Preparation) -> Self {
|
||||||
let cap = p.text.len();
|
let cap = p.text.len();
|
||||||
|
|
||||||
let mut widths = CummulativeVec::with_capacity(cap);
|
let mut widths = CumulativeVec::with_capacity(cap);
|
||||||
let mut stretchability = CummulativeVec::with_capacity(cap);
|
let mut stretchability = CumulativeVec::with_capacity(cap);
|
||||||
let mut shrinkability = CummulativeVec::with_capacity(cap);
|
let mut shrinkability = CumulativeVec::with_capacity(cap);
|
||||||
let mut justifiables = CummulativeVec::with_capacity(cap);
|
let mut justifiables = CumulativeVec::with_capacity(cap);
|
||||||
|
|
||||||
for (range, item) in p.items.iter() {
|
for (range, item) in p.items.iter() {
|
||||||
if let Item::Text(shaped) = item {
|
if let Item::Text(shaped) = item {
|
||||||
@ -919,12 +919,12 @@ impl Estimates {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// An accumulative array of a metric.
|
/// An accumulative array of a metric.
|
||||||
struct CummulativeVec<T> {
|
struct CumulativeVec<T> {
|
||||||
total: T,
|
total: T,
|
||||||
summed: Vec<T>,
|
summed: Vec<T>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T> CummulativeVec<T>
|
impl<T> CumulativeVec<T>
|
||||||
where
|
where
|
||||||
T: Default + Copy + Add<Output = T> + Sub<Output = T>,
|
T: Default + Copy + Add<Output = T> + Sub<Output = T>,
|
||||||
{
|
{
|
||||||
|
@ -123,7 +123,7 @@ pub struct ParElem {
|
|||||||
#[resolve]
|
#[resolve]
|
||||||
pub hanging_indent: Length,
|
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
|
/// This property is set to `false` on raw blocks, because shrinking a line
|
||||||
/// could visually break the indentation.
|
/// could visually break the indentation.
|
||||||
|
@ -39,9 +39,9 @@ use crate::visualize::{Paint, Stroke};
|
|||||||
/// your presentation by arranging unrelated content in a grid. In the former
|
/// 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
|
/// 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
|
/// appropriate. Furthermore, Typst will annotate its output in the future such
|
||||||
/// that screenreaders will annouce content in `table` as tabular while a grid's
|
/// that screenreaders will announce content in `table` as tabular while a
|
||||||
/// content will be announced no different than multiple content blocks in the
|
/// grid's content will be announced no different than multiple content blocks
|
||||||
/// document flow.
|
/// in the document flow.
|
||||||
///
|
///
|
||||||
/// Note that, to override a particular cell's properties or apply show rules on
|
/// 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
|
/// table cells, you can use the [`table.cell`]($table.cell) element. See its
|
||||||
|
@ -128,7 +128,7 @@ impl Show for Packed<SuperElem> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Find and transform the text contained in `content` to the given script kind
|
/// 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> {
|
fn search_text(content: &Content, sub: bool) -> Option<EcoString> {
|
||||||
if content.is::<SpaceElem>() {
|
if content.is::<SpaceElem>() {
|
||||||
Some(' '.into())
|
Some(' '.into())
|
||||||
|
@ -89,7 +89,7 @@ impl<'a> Logger<'a> {
|
|||||||
let Self { selected, passed, failed, skipped, .. } = *self;
|
let Self { selected, passed, failed, skipped, .. } = *self;
|
||||||
|
|
||||||
eprintln!("{passed} passed, {failed} failed, {skipped} skipped");
|
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 {
|
if self.mismatched_image {
|
||||||
eprintln!(" pass the --update flag to update the reference images");
|
eprintln!(" pass the --update flag to update the reference images");
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
--- measure-counter-width ---
|
--- measure-counter-width ---
|
||||||
// Measure a counter. Tests that the introspector-assisted location assignment
|
// Measure a counter. Tests that the introspector-assisted location assignment
|
||||||
// is able to take `here()` from the context into account to find the closest
|
// 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`.
|
// the same `context c.display()` to get the same span, hence `it`.
|
||||||
#let f(it) = context [
|
#let f(it) = context [
|
||||||
Is #measure(it).width wide: #it \
|
Is #measure(it).width wide: #it \
|
||||||
|
@ -47,7 +47,7 @@ $ A = 1 $ <eq2>
|
|||||||
#set ref(supplement: none)
|
#set ref(supplement: none)
|
||||||
@fig1, @fig2, @eq1, @eq2
|
@fig1, @fig2, @eq1, @eq2
|
||||||
|
|
||||||
--- ref-ambigious ---
|
--- ref-ambiguous ---
|
||||||
// Test ambiguous reference.
|
// Test ambiguous reference.
|
||||||
= Introduction <arrgh>
|
= Introduction <arrgh>
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ class TestHelper {
|
|||||||
// The current zoom scale.
|
// The current zoom scale.
|
||||||
scale = 1.0;
|
scale = 1.0;
|
||||||
|
|
||||||
// The extention's status bar item.
|
// The extension's status bar item.
|
||||||
statusItem: vscode.StatusBarItem;
|
statusItem: vscode.StatusBarItem;
|
||||||
|
|
||||||
// The active message of the status item.
|
// The active message of the status item.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user