From 3d7dea6dfdc9e75dcca100a79525aa3736dbe29c Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 11 Oct 2018 10:32:08 -0400 Subject: [PATCH] [trak] Handle nSizes=0 and 1 --- src/hb-aat-layout-trak-table.hh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/hb-aat-layout-trak-table.hh b/src/hb-aat-layout-trak-table.hh index 63dd890c5..368c55c12 100644 --- a/src/hb-aat-layout-trak-table.hh +++ b/src/hb-aat-layout-trak-table.hh @@ -93,7 +93,9 @@ struct TrackData Fixed fixed_size; fixed_size.set_float (csspx); - /* XXX Clean this up. Make it work with nSizes==1 and 0. */ + /* + * Choose track. + */ const TrackTableEntry *trackTableEntry = nullptr; unsigned int count = nTracks; @@ -112,8 +114,15 @@ struct TrackData } if (!trackTableEntry) return 0.; + /* + * Choose size. + */ + unsigned int sizes = nSizes; + if (!sizes) return 0.; + if (sizes == 1) return trackTableEntry->get_value (base, 0, sizes); + /* TODO bfind() */ unsigned int size_index; UnsizedArrayOf size_table = base+sizeTable;