のねのBlog

パソコンの問題や、ソフトウェアの開発で起きた問題など書いていきます。よろしくお願いします^^。

2018-07-24から1日間の記事一覧

packed delta その6

カウントは1バイトまたは2バイトで格納されます。 第1のバイトを読み取った後、第2のバイトの必要性を判定することができる。 カウントバイトは次のように処理されます。最初のバイトが0の場合、2番目のカウントバイトは使用されません。 この値には特別な意…

packed delta その5

# all points in glyph (in overly verbose encoding, not explicitly prohibited by spec) #グリフ内のすべての点(仕様によって明示的に禁止されていない、過度に冗長なエンコーディング)https://github.com/fonttools/fonttools/blob/master/Tests/ttLi…

packed delta その4

@staticmethod def decompilePoints_(numPoints, data, offset, tableTag): """(numPoints, data, offset, tableTag) --> ([point1, point2, ...], newOffset)""" assert tableTag in ('cvar', 'gvar') pos = offset numPointsInData = byteord(data[pos]) p…

packed delta その3

def test_compilePoints(self): compilePoints = lambda p: TupleVariation.compilePoints(set(p), numPointsInGlyph=999) self.assertEqual("00", hexencode(compilePoints(range(999)))) # all points in glyph self.assertEqual("01 00 07", hexencode(co…

packed delta その2

staticmethod def compilePoints(points, numPointsInGlyph): # If the set consists of all points in the glyph, it gets encoded with # a special encoding: a single zero byte. if len(points) == numPointsInGlyph: return b"\0"https://github.com/f…

packed delta

VariableFontのPackedDeltaを解析していて、先頭に、0x00があるときがある。 この意味がよくわからない。例 AdobeVFPrototype.ttfgvar - “.notdef” - tuple2 dump 0000A75A 0000A750 -- -- -- -- -- -- -- -- -- -- -- -- 00 80 0A EC 00 14 .##............…

gvar packed delta

static FT_Short* ft_var_readpackeddeltas( FT_Stream stream, FT_Offset delta_cnt ) { FT_Short *deltas = NULL; FT_UInt runcnt; FT_Offset i; FT_UInt j; FT_Memory memory = stream->memory; FT_Error error = FT_Err_Ok; FT_UNUSED( error ); if ( FT…