Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unsafe precondition(s) violated #243

Merged
merged 5 commits into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 44 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
- uses: Swatinem/rust-cache@v2
- run: cargo check --workspace --examples --tests --release
- run: cargo clean
test:
test-ubuntu:
runs-on: ubuntu-latest
needs: [check]
env:
Expand All @@ -68,6 +68,48 @@ jobs:
- uses: Swatinem/rust-cache@v2
- run: cargo do test --nextest
- run: cargo clean
test-windows:
runs-on: windows-latest
needs: [check]
env:
ZNG_TP_LICENSES: true
NEXTEST_RETRIES: 3
CC: 'clang-cl'
CXX: 'clang-cl'
steps:
- uses: dtolnay/rust-toolchain@stable
- name: install cargo-about
uses: baptiste0928/cargo-install@v3
with:
crate: cargo-about
- name: install cargo-nextest
uses: taiki-e/install-action@v2
with:
tool: cargo-nextest
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- run: cargo do test --nextest
- run: cargo clean
test-macos:
runs-on: macos-latest
needs: [check]
env:
ZNG_TP_LICENSES: true
NEXTEST_RETRIES: 3
steps:
- uses: dtolnay/rust-toolchain@stable
- name: install cargo-about
uses: baptiste0928/cargo-install@v3
with:
crate: cargo-about
- name: install cargo-nextest
uses: taiki-e/install-action@v2
with:
tool: cargo-nextest
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- run: cargo do test --nextest
- run: cargo clean
test-doc:
runs-on: ubuntu-latest
needs: [check]
Expand All @@ -90,6 +132,6 @@ jobs:
- run: cargo clean
test-all:
runs-on: ubuntu-latest
needs: [check-release, doc, test, test-doc, test-macro]
needs: [check-release, doc, test-ubuntu, test-windows, test-macos, test-doc, test-macro]
steps:
- run: exit 0
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ jobs:
- run: cargo clean
if: ${{ github.event.inputs.skip_checks != 'true' }}
check-macos:
runs-on: macos-13
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
if: ${{ github.event.inputs.skip_checks != 'true' }}
Expand Down Expand Up @@ -225,7 +225,7 @@ jobs:
name: prebuilt-windows
path: crates/zng-view-prebuilt/lib/zng_view.dll
prebuild-macos:
runs-on: macos-13
runs-on: macos-latest
needs: [check-macos]
env:
ZNG_TP_LICENSES: true
Expand Down Expand Up @@ -392,7 +392,7 @@ jobs:
- run: cargo clean
if: ${{ github.event.inputs.skip_tests != 'true' }}
test-macos:
runs-on: macos-13
runs-on: macos-latest
needs: [prebuild-macos]
env:
NEXTEST_RETRIES: 3
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* Fix `Img::copy_pixels`.
* Fix `view_process::default::run_same_process` exit in headless runs.
* Fix `AutoGrowMode::rows` actually enabling Columns auto grow.
* Fix "unsafe precondition(s) violated" issue ([#242](https://github.com/zng-ui/zng/issues/242)).

# 0.6.1

Expand Down
5 changes: 3 additions & 2 deletions crates/zng-ext-font/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1019,7 +1019,7 @@ impl FontFace {
} else {
ColorGlyphs::load(&font)?
};
let has_ligatures = face.table_with_tag(b"GSUB").is_some();
let has_ligatures = font.load_font_table(GSUB).is_some();
let lig_carets = if has_ligatures {
LigatureCaretList::empty()
} else {
Expand Down Expand Up @@ -1094,7 +1094,8 @@ impl FontFace {
} else {
ColorGlyphs::load(&font)?
};
let has_ligatures = face.table_with_tag(b"GSUB").is_some();

let has_ligatures = font.load_font_table(GSUB).is_some();
let lig_carets = if has_ligatures {
LigatureCaretList::empty()
} else {
Expand Down
1 change: 1 addition & 0 deletions crates/zng-ext-font/src/ligature_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use core::cmp;
use byteorder::{BigEndian, ReadBytesExt};
use zng_view_api::font::GlyphIndex;

pub const GSUB: u32 = u32::from_be_bytes(*b"GSUB");
const GDEF: u32 = u32::from_be_bytes(*b"GDEF");

#[derive(Clone)]
Expand Down
Loading