Fix DCP content font ID allocation to cope with DCPs that have multiple fonts
authorCarl Hetherington <cth@carlh.net>
Sat, 14 Oct 2023 19:48:25 +0000 (21:48 +0200)
committerCarl Hetherington <cth@carlh.net>
Sun, 15 Oct 2023 07:10:18 +0000 (09:10 +0200)
commit3c802dd6d1451c2c8a7e188f8379738d72e907eb
tree454396cf5451535b8708a0c4961c7d5c2b30ea1f
parent1bfe44b1503fb0f5cffda135076709014337de52
Fix DCP content font ID allocation to cope with DCPs that have multiple fonts
with the same name in the same reel (#2600).

Previously we had this id_for_font_in_reel() which would give an ID
of N_font-ID.  This means we got duplicate font IDs.

Here we replace that method with FontAllocator, which gives an ID of
N_font-ID for the first font and M_font-ID, where M is a number higher than
the highest reel index.  The idea is to support the required new IDs
without breaking exisiting projects.

There is some documentation of how it works  in doc/design/fonts
17 files changed:
doc/design/fonts [new file with mode: 0644]
src/lib/dcp_content.cc
src/lib/dcp_content.h
src/lib/dcp_decoder.cc
src/lib/dcp_decoder.h
src/lib/dcp_examiner.cc
src/lib/dcp_examiner.h
src/lib/font_id_allocator.cc [new file with mode: 0644]
src/lib/font_id_allocator.h [new file with mode: 0644]
src/lib/writer.cc
src/lib/wscript
test/data
test/font_id_allocator_test.cc [new file with mode: 0644]
test/hints_test.cc
test/vf_test.cc
test/writer_test.cc
test/wscript