W3C home > Mailing lists > Public > www-font@w3.org > July to September 2009

RE: EOTL font file specification version 1

From: Levantovsky, Vladimir <Vladimir.Levantovsky@MonotypeImaging.com>
Date: Fri, 7 Aug 2009 09:43:04 -0400
Message-ID: <E955AA200CF46842B46F49B0BBB83FF297F366@wil-email-01.agfamonotype.org>
To: "Mikko Rantalainen" <mikko.rantalainen@peda.net>, "www-font" <www-font@w3.org>
On Friday, August 07, 2009 7:42 AM Mikko Rantalainen wrote:

> Checking for version numbers, feature flags or magic numbers
> cannot guarantee that the font data can be loaded (e.g. it could be
> corrupted by mistake or because of malice).
> 

Agree, but it can help to easily (and with minimal overhead) identify those cases when font data cannot be loaded.

> 
> I'd would assume that the OS/font subsystem that is trying to load the
> OpenType font already checks if the input file is indeed a valid
> OpenType font. Any additional checks before that are wasted CPU time
> for a valid font file. And hopefully the OS/font subsystem is sane
> enough to immediately return if an error is found. So that is not an
> optimization even for invalid fonts. (There can be additional
> optimizations but none of those need to be codified by the
> specification.)
> 

An attempt to load an invalid font would result in much more overhead and wasted CPU time. Checking flags to see if this can be completely avoided seems to be perfectly reasonable and useful; and it would require much less of CPU time to check whether particular bits in a bitfield are set vs. making a function call and see if it returns an error condition. I agree that the spec doesn't need to spell out for implementers what can be optimized and how to do it, but since the flags are part of the header data, the spec should at least identify the location and the meaning of those flags, IMO. 


Vladimir
Received on Friday, 7 August 2009 13:43:45 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Saturday, 11 June 2011 00:14:03 GMT