[ucd] Change OPTIMIZE_SIZE to compression level 9

Also changes default compression level from 3 to 5, but that shows
no change in the generated table size.
This commit is contained in:
Behdad Esfahbod 2022-11-19 13:14:18 -07:00
parent b68f9f3cfe
commit ba08de624e
2 changed files with 1619 additions and 1793 deletions

View File

@ -83,10 +83,15 @@ for line in open(hb_common_h):
sc_order[i] = tag sc_order[i] = tag
sc_array.append(name) sc_array.append(name)
DEFAULT = 3 DEFAULT = 'DEFAULT'
COMPACT = 5 COMPACT = 'COMPACT'
SLOPPY = 9 SLOPPY = 'SLOPPY'
compression_level = {
DEFAULT: 5,
COMPACT: 9,
SLOPPY: 9,
}
logging.info('Generating output...') logging.info('Generating output...')
print("/* == Start of generated table == */") print("/* == Start of generated table == */")
@ -120,18 +125,21 @@ datasets = [
('dm', dm, None, dm_order), ('dm', dm, None, dm_order),
] ]
for compression in (DEFAULT, COMPACT, SLOPPY): for step in (DEFAULT, COMPACT, SLOPPY):
compression = compression_level[step]
logging.info(' Compression=%d:' % compression) logging.info(' Compression=%d:' % compression)
print() print()
if compression == DEFAULT: if step == DEFAULT:
print('#ifndef HB_OPTIMIZE_SIZE') print('#ifndef HB_OPTIMIZE_SIZE')
elif compression == COMPACT: elif step == COMPACT:
print('#elif !defined(HB_NO_UCD_UNASSIGNED)') print('#elif !defined(HB_NO_UCD_UNASSIGNED)')
else: elif step == SLOPPY:
print('#else') print('#else')
else:
assert False
print() print()
if compression == SLOPPY: if step == SLOPPY:
for i in range(len(gc)): for i in range(len(gc)):
if (i % 128) and gc[i] == 'Cn': if (i % 128) and gc[i] == 'Cn':
gc[i] = gc[i - 1] gc[i] = gc[i - 1]

File diff suppressed because it is too large Load Diff