freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ft-devel] Support standardized CBDT/CBLC


From: Behdad Esfahbod
Subject: Re: [ft-devel] Support standardized CBDT/CBLC
Date: Sat, 7 Nov 2015 07:55:57 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

On 15-10-07 11:17 AM, Werner LEMBERG wrote:
>> Apparently somewhere during the standardization, CBDT/CBLC got their
>> version bumped to 3:
>>
>>   https://www.microsoft.com/typography/otspec/cblc.htm
>>   https://www.microsoft.com/typography/otspec/cbdt.htm
> 
> Ah, I've missed that.
> 
>> FreeType currently only accepts 2, which is the number we used in
>> our proposal.  ttsbit.c needs to be updated to accept 3.  I suggest
>> we accept both 2 and 3 for both color and non-color versions of
>> this.
> 
> Sounds reasonable.
> 
>> Whatever you do, please don't break our existing fonts, that is,
>> CBLC/CBDT with version number 2.
> 
> :-)  Can you provide a patch?

Here's a starter, to accept both version 2 and 3 in both color and b/w tables:

diff --git a/src/sfnt/ttsbit.c b/src/sfnt/ttsbit.c
index 62bce3c..09260b8 100644
--- a/src/sfnt/ttsbit.c
+++ b/src/sfnt/ttsbit.c
@@ -104,7 +104,8 @@
         version     = FT_NEXT_LONG( p );
         num_strikes = FT_NEXT_ULONG( p );

-        if ( ( (FT_ULong)version & 0xFFFF0000UL ) != 0x00020000UL )
+        if ( ( (FT_ULong)version & 0xFFFF0000UL ) != 0x00020000UL &&
+             ( (FT_ULong)version & 0xFFFF0000UL ) != 0x00030000UL )
         {
           error = FT_THROW( Unknown_File_Format );
           goto Exit;

I don't know why someone decided to bump the version :(.  But there's water
under the bridge both ways.  I might send additional patches to tighten things
up, but this should be harmless and good enough.  Let's get this in.

Thanks,
-- 
behdad
http://behdad.org/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]