@@ -249,14 +249,42 @@ def test_update_maxp_table():
249249# =========================================
250250# head table edits
251251# =========================================
252- def test_update_head_table_flags ():
252+ def test_update_head_table_flags_without_ltsh_hdmx ():
253253 tt = TTFont (FILEPATH_HINTED_TTF )
254254 assert (tt ["head" ].flags & (1 << 4 )) != 0
255+ remove_hdmx_table (tt )
256+ remove_ltsh_table (tt )
255257 response = update_head_table_flags (tt )
256258 assert response is True
257259 assert (tt ["head" ].flags & (1 << 4 )) == 0
258260
259261
262+ def test_update_head_table_flags_with_ltsh_hdmx ():
263+ tt = TTFont (FILEPATH_HINTED_TTF )
264+ assert (tt ["head" ].flags & (1 << 4 )) != 0
265+ response = update_head_table_flags (tt )
266+ assert response is False
267+ assert (tt ["head" ].flags & (1 << 4 )) != 0
268+
269+
270+ def test_update_head_table_flags_with_ltsh ():
271+ tt = TTFont (FILEPATH_HINTED_TTF )
272+ assert (tt ["head" ].flags & (1 << 4 )) != 0
273+ remove_hdmx_table (tt )
274+ response = update_head_table_flags (tt )
275+ assert response is False
276+ assert (tt ["head" ].flags & (1 << 4 )) != 0
277+
278+
279+ def test_update_head_table_flags_with_hdmx ():
280+ tt = TTFont (FILEPATH_HINTED_TTF )
281+ assert (tt ["head" ].flags & (1 << 4 )) != 0
282+ remove_ltsh_table (tt )
283+ response = update_head_table_flags (tt )
284+ assert response is False
285+ assert (tt ["head" ].flags & (1 << 4 )) != 0
286+
287+
260288def test_update_head_table_flags_previously_cleared ():
261289 tt = TTFont (FILEPATH_HINTED_TTF_2 )
262290 assert (tt ["head" ].flags & (1 << 4 )) == 0
0 commit comments