diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 99e49a444..d196c3cb6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -103,3 +103,12 @@ jobs: run: | qmake nmake + + # If this fails, consider changing your text or adding something to .typos.toml. + typos: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: check typos + uses: crate-ci/typos@v1.28.4 diff --git a/.typos.toml b/.typos.toml new file mode 100644 index 000000000..389e359e0 --- /dev/null +++ b/.typos.toml @@ -0,0 +1,28 @@ +# See the configuration reference at +# https://github.com/crate-ci/typos/blob/master/docs/reference.md + +# Corrections take the form of a key/value pair. The key is the incorrect word +# and the value is the correct word. If the key and value are the same, the +# word is treated as always correct. If the value is an empty string, the word +# is treated as always incorrect. + +# Match Identifier - Case Sensitive +[default.extend-identifiers] +ba = "ba" +flate2 = "flate2" +Hel = "Hel" +PNGs = "PNGs" +SVGinOT = "SVGinOT" + +# Match Inside a Word - Case Insensitive +[default.extend-words] + +[files] +# Include .github, .cargo, etc. +ignore-hidden = false +extend-exclude = [ + # /.git isn't in .gitignore, because git never tracks it. + # Typos doesn't know that, though. + "/.git", + "*.svg", +] diff --git a/CHANGELOG.md b/CHANGELOG.md index 64103a0eb..290efc6dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1065,7 +1065,7 @@ This changelog also contains important changes in dependencies. - `letter-spacing` on cursive scripts (like Arabic). - (rctree) Prevent stack overflow on a huge, deeply nested SVG. - (c-api) `resvg_is_image_empty` was always returning `false`. -- (resvg) Panic when `filter` with `objectBoudningBox` was set on an empty group. +- (resvg) Panic when `filter` with `objectBoundingBox` was set on an empty group. - (usvg) `mask` with `objectBoundingBox` resolving. - (usvg) `pattern`'s `viewBox` attribute resolving via `href`. - (roxmltree) Namespace resolving. @@ -1126,7 +1126,7 @@ This changelog also contains important changes in dependencies. ### Fixed - Object bounding box calculation. - Pattern scaling. -- Nested `objectBoundigBox` support. +- Nested `objectBoundingBox` support. - (usvg) `color` on `use` resolving. - (usvg) `offset` attribute resolving inside the `stop` element. - (usvg) Ungrouping of groups with non-inheritable attributes. diff --git a/crates/resvg/src/filter/mod.rs b/crates/resvg/src/filter/mod.rs index 358285db5..c70001a36 100644 --- a/crates/resvg/src/filter/mod.rs +++ b/crates/resvg/src/filter/mod.rs @@ -24,7 +24,7 @@ mod turbulence; /// /// Image pixels should be stored in RGBA order. /// -/// Some filters will require premultipled channels, some not. +/// Some filters will require premultiplied channels, some not. /// See specific filter documentation for details. #[derive(Clone, Copy)] pub struct ImageRef<'a> { diff --git a/crates/resvg/tests/integration/render.rs b/crates/resvg/tests/integration/render.rs index c8a385055..3118508a3 100644 --- a/crates/resvg/tests/integration/render.rs +++ b/crates/resvg/tests/integration/render.rs @@ -366,7 +366,7 @@ use crate::render; #[test] fn filters_filter_functions_color_adjust_functions_negative() { assert_eq!(render("tests/filters/filter-functions/color-adjust-functions-negative"), 0); } #[test] fn filters_filter_functions_drop_shadow_function_color_as_attribute() { assert_eq!(render("tests/filters/filter-functions/drop-shadow-function-color-as-attribute"), 0); } #[test] fn filters_filter_functions_drop_shadow_function_color_last() { assert_eq!(render("tests/filters/filter-functions/drop-shadow-function-color-last"), 0); } -#[test] fn filters_filter_functions_drop_shadow_function_comma_spearated() { assert_eq!(render("tests/filters/filter-functions/drop-shadow-function-comma-spearated"), 0); } +#[test] fn filters_filter_functions_drop_shadow_function_comma_separated() { assert_eq!(render("tests/filters/filter-functions/drop-shadow-function-comma-separated"), 0); } #[test] fn filters_filter_functions_drop_shadow_function_currentColor() { assert_eq!(render("tests/filters/filter-functions/drop-shadow-function-currentColor"), 0); } #[test] fn filters_filter_functions_drop_shadow_function_em_values() { assert_eq!(render("tests/filters/filter-functions/drop-shadow-function-em-values"), 0); } #[test] fn filters_filter_functions_drop_shadow_function_extra_value() { assert_eq!(render("tests/filters/filter-functions/drop-shadow-function-extra-value"), 0); } diff --git a/crates/resvg/tests/tests/filters/filter-functions/drop-shadow-function-comma-spearated.png b/crates/resvg/tests/tests/filters/filter-functions/drop-shadow-function-comma-separated.png similarity index 100% rename from crates/resvg/tests/tests/filters/filter-functions/drop-shadow-function-comma-spearated.png rename to crates/resvg/tests/tests/filters/filter-functions/drop-shadow-function-comma-separated.png diff --git a/crates/resvg/tests/tests/filters/filter-functions/drop-shadow-function-comma-spearated.svg b/crates/resvg/tests/tests/filters/filter-functions/drop-shadow-function-comma-separated.svg similarity index 84% rename from crates/resvg/tests/tests/filters/filter-functions/drop-shadow-function-comma-spearated.svg rename to crates/resvg/tests/tests/filters/filter-functions/drop-shadow-function-comma-separated.svg index 0461d8b72..7178cc996 100644 --- a/crates/resvg/tests/tests/filters/filter-functions/drop-shadow-function-comma-spearated.svg +++ b/crates/resvg/tests/tests/filters/filter-functions/drop-shadow-function-comma-separated.svg @@ -1,5 +1,5 @@ - `drop-shadow` function, comma spearated (SVG 2) + `drop-shadow` function, comma separated (SVG 2) Commas are not allowed. cmbBoxBackground->setCurrentIndex(1); ui->svgView->setFitToView(true); - ui->svgView->setBackgound(SvgView::Backgound::White); + ui->svgView->setBackground(SvgView::Background::White); connect(ui->svgView, &SvgView::loadError, this, [this](const QString &msg){ QMessageBox::critical(this, "Error", msg); @@ -52,7 +52,7 @@ void MainWindow::on_cmbBoxSize_activated(int index) void MainWindow::on_cmbBoxBackground_activated(int index) { - ui->svgView->setBackgound(SvgView::Backgound(index)); + ui->svgView->setBackground(SvgView::Background(index)); } void MainWindow::on_chBoxDrawBorder_toggled(bool checked) diff --git a/tools/viewsvg/svgview.cpp b/tools/viewsvg/svgview.cpp index 0e82ead1e..965f00714 100644 --- a/tools/viewsvg/svgview.cpp +++ b/tools/viewsvg/svgview.cpp @@ -130,9 +130,9 @@ void SvgView::setFitToView(bool flag) requestUpdate(); } -void SvgView::setBackgound(SvgView::Backgound backgound) +void SvgView::setBackground(SvgView::Background background) { - m_backgound = backgound; + m_background = background; update(); } @@ -198,12 +198,12 @@ void SvgView::paintEvent(QPaintEvent *e) const auto r = contentsRect(); p.setClipRect(r); - switch (m_backgound) { - case Backgound::None : break; - case Backgound::White : { + switch (m_background) { + case Background::None : break; + case Background::White : { p.fillRect(contentsRect(), Qt::white); } break; - case Backgound::CheckBoard : { + case Background::CheckBoard : { p.fillRect(contentsRect(), QBrush(m_checkboardImg)); } break; } diff --git a/tools/viewsvg/svgview.h b/tools/viewsvg/svgview.h index 1d5760cc1..3c88d5739 100644 --- a/tools/viewsvg/svgview.h +++ b/tools/viewsvg/svgview.h @@ -38,7 +38,7 @@ class SvgView : public QWidget Q_OBJECT public: - enum class Backgound + enum class Background { None, White, @@ -51,7 +51,7 @@ class SvgView : public QWidget static void init(); void setFitToView(bool flag); - void setBackgound(Backgound backgound); + void setBackground(Background background); void setDrawImageBorder(bool flag); void loadData(const QByteArray &data); @@ -84,7 +84,7 @@ private slots: QString m_path; float m_dpiRatio = 1.0; bool m_isFitToView = true; - Backgound m_backgound = Backgound::CheckBoard; + Background m_background = Background::CheckBoard; bool m_isDrawImageBorder = false; bool m_isHasImage = false; QImage m_img;