From 3c84aa52f20d3afa47bba151a7841ac7b5edb488 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 7 Feb 2025 13:52:32 +0000 Subject: [PATCH] [hvgl] Move transforms around This doesn't seem to quite match the spec. But produces fewer wrong shapes. Down to 834 out of 34485 characters. --- src/hb-aat-var-hvgl-table.cc | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/hb-aat-var-hvgl-table.cc b/src/hb-aat-var-hvgl-table.cc index 3848baa98..86c572c6c 100644 --- a/src/hb-aat-var-hvgl-table.cc +++ b/src/hb-aat-var-hvgl-table.cc @@ -343,23 +343,6 @@ PartComposite::apply_to_transforms (hb_array_t> transform const auto &extremumRotationIndex = StructAfter (extremumRotationDelta, sparseExtremumRotationCount); const auto &masterRotationIndex = StructAfter (extremumRotationIndex, sparseExtremumRotationCount); - { - const auto master_rotation_indices = masterRotationIndex.arrayZ; - const auto master_rotation_deltas = masterRotationDelta.arrayZ; - unsigned count = sparseMasterRotationCount; - for (unsigned i = 0; i < count; i++) - transforms[master_rotation_indices[i]].rotate ((double) master_rotation_deltas[i], true); - } - { - const auto master_translation_indices = masterTranslationIndex.arrayZ; - const auto master_translation_deltas = masterTranslationDelta.arrayZ; - unsigned count = sparseMasterTranslationCount; - for (unsigned i = 0; i < count; i++) - transforms[master_translation_indices[i]].translate ((double) master_translation_deltas[i].x, - (double) master_translation_deltas[i].y, - true); - } - auto extremum_translation_indices = extremumTranslationIndex.arrayZ; auto extremum_translation_deltas = extremumTranslationDelta.arrayZ; unsigned extremum_translation_count = sparseExtremumTranslationCount; @@ -436,6 +419,23 @@ PartComposite::apply_to_transforms (hb_array_t> transform (double) extremum_translation_delta.y * scalar, true); } } + + { + const auto master_rotation_indices = masterRotationIndex.arrayZ; + const auto master_rotation_deltas = masterRotationDelta.arrayZ; + unsigned count = sparseMasterRotationCount; + for (unsigned i = 0; i < count; i++) + transforms[master_rotation_indices[i]].rotate ((double) master_rotation_deltas[i], true); + } + { + const auto master_translation_indices = masterTranslationIndex.arrayZ; + const auto master_translation_deltas = masterTranslationDelta.arrayZ; + unsigned count = sparseMasterTranslationCount; + for (unsigned i = 0; i < count; i++) + transforms[master_translation_indices[i]].translate ((double) master_translation_deltas[i].x, + (double) master_translation_deltas[i].y, + true); + } } void