mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-21 15:01:01 +01:00
[beyond-64k] Preserve CursivePos format when subsetting
CursivePos format 2 reuses the templated format-1 body with wider fields. Preserve the source format when serializing subsets so a format-2 subtable is not emitted with a format-1 tag. Testing: meson test -C build Assisted-by: OpenAI Codex
This commit is contained in:
1 parent
4997b9f75c
commit
eb8d87f024
2 files changed
+9
-9
No files matched your search
@@ -293,7 +293,7 @@ struct CursivePosFormat1_2
|
||||
const struct CursivePosFormat1_2<Types> *src_base)
|
||||
{
|
||||
if (unlikely (!c->serializer->extend_min ((*this)))) return;
|
||||
this->format = 1;
|
||||
this->format = src_base->format;
|
||||
this->entryExitRecord.len = it.len ();
|
||||
|
||||
for (const EntryExitRecord<Types>& entry_record : + it
|
||||
@@ -316,13 +316,13 @@ struct CursivePosFormat1_2
|
||||
|
||||
auto *out = c->serializer->start_embed (*this);
|
||||
|
||||
auto it =
|
||||
+ hb_zip (this+coverage, entryExitRecord)
|
||||
| hb_filter (glyphset, hb_first)
|
||||
| hb_map_retains_sorting ([&] (hb_pair_t<hb_codepoint_t, const EntryExitRecord<Types>&> p)
|
||||
-> hb_pair_t<hb_codepoint_t, const EntryExitRecord<Types>&>
|
||||
{ return hb_pair (glyph_map[p.first], p.second);})
|
||||
;
|
||||
auto it =
|
||||
+ hb_zip (this+coverage, entryExitRecord)
|
||||
| hb_filter (glyphset, hb_first)
|
||||
| hb_map_retains_sorting ([&] (hb_pair_t<hb_codepoint_t, const EntryExitRecord<Types>&> p)
|
||||
-> hb_pair_t<hb_codepoint_t, const EntryExitRecord<Types>&>
|
||||
{ return hb_pair (glyph_map[p.first], p.second);})
|
||||
;
|
||||
|
||||
bool ret = bool (it);
|
||||
out->serialize (c, it, this);
|
||||
|
||||
@@ -61,7 +61,7 @@ struct MediumTypes {
|
||||
using HBUINT = HBUINT24;
|
||||
using HBGlyphID = HBGlyphID24;
|
||||
using Offset = Offset24;
|
||||
/* Long offsets for large tables. */
|
||||
/* Long offsets for large tables. */
|
||||
using LOffset = Offset32;
|
||||
template <typename Type, typename BaseType=void, bool has_null=true>
|
||||
using OffsetTo = OT::Offset24To<Type, BaseType, has_null>;
|
||||
|
||||
Reference in new issue
Block a user