googlefonts / fontations

Reading and writing font files
Apache License 2.0
396 stars 26 forks source link

Subtraction underflow in hinting instance creation with old Savoye Font #1217

Closed drott closed 2 weeks ago

drott commented 2 weeks ago

When creating a hinting instance for "Savoye LET" a panic occurs in graphics.rs:

   3: skrifa::outline::glyf::hint::engine::graphics::<impl skrifa::outline::glyf::hint::engine::Engine>::op_instctrl
             at ./src/outline/glyf/hint/engine/graphics.rs:565:34
   4: skrifa::outline::glyf::hint::engine::dispatch::<impl skrifa::outline::glyf::hint::engine::Engine>::dispatch_inner
             at ./src/outline/glyf/hint/engine/dispatch.rs:223:25
   5: skrifa::outline::glyf::hint::engine::dispatch::<impl skrifa::outline::glyf::hint::engine::Engine>::dispatch
             at ./src/outline/glyf/hint/engine/dispatch.rs:89:9
   6: skrifa::outline::glyf::hint::engine::dispatch::<impl skrifa::outline::glyf::hint::engine::Engine>::run
             at ./src/outline/glyf/hint/engine/dispatch.rs:59:13
   7: skrifa::outline::glyf::hint::engine::dispatch::<impl skrifa::outline::glyf::hint::engine::Engine>::run_program
             at ./src/outline/glyf/hint/engine/dispatch.rs:16:9
   8: skrifa::outline::glyf::hint::instance::HintInstance::reconfigure
             at ./src/outline/glyf/hint/instance.rs:77:9

Repro: https://github.com/drott/fontations/commit/fe16ca2fe60be6efb46e4b6ba175643d1425ada3

Spun off from: https://issues.chromium.org/377210677

Font attached, originally downloaded from https://static.wixstatic.com/ufonts/01718a_08ee95d85dbb49b19b380d68a773e2bc/woff2/file.woff2

SavoyeLTE.zip

Font is proprietary and must not be added to repository.

dfrg commented 2 weeks ago

Oh, this one will be fixed by #1202

drott commented 2 weeks ago

Fixed with https://github.com/googlefonts/fontations/pull/1202