How can an out of date implementation gracefully process a new version of an OpenType font? -


you'll find below following text in section version numbers of ms opentype font file specification:

implementations reading tables must include code check version numbers that, if , when format , therefore version number changes, older implementations handle newer versions gracefully.

suppose 1 has written code read opentype font file version 1 , later on, code used process same font file, version 2. can't imagine how "gracefully" succeed, unless above statement means 1 has update code final version of font file, before processing it.

you mistaking "graceful" "still parses font file". idea of spec there version numbers every parser explicitly checks version number, continues parsing versions knows how parse, , reports , deterministically behaves on versions not know with.

graceful:

  • start reading table
  • read version number table struct
  • check version number
  • branch parsing function known version number
  • report inability continue parsing unknown version number
  • cancel parse run in deterministic, documented way
  • application uses parser can gracefully deal "cannot load request font" situation in.

not graceful:

  • start reading table
  • read bytes struct reflects date opentype table format when parser got written.
  • end corrupt data on version mismatch, possibly hard crash there , due accessing memory outside allocated range table.
  • possibly serve corrupted data and/or crash later because offsets wrong
  • possibly crash the application uses parser because corrupt data returned, or parser crash hard enough kill process
  • possibly ... etc. etc.

there 0 expectation parser able parse newer opentype table formats, should absolutely deal them in graceful manner, checking whether versions match knows how work with, , reporting inability parse data has no parsing rules for, clean exit allows consuming applications need do.


Comments

Popular posts from this blog

php - Permission denied. Laravel linux server -

google bigquery - Delta between query execution time and Java query call to finish -

python - Pandas two dataframes multiplication? -