[os2] Inline a trivial function

This commit is contained in:
Behdad Esfahbod 2023-01-12 18:29:16 -07:00
parent 075fe33446
commit 2dcbf3bd07
1 changed files with 2 additions and 14 deletions

View File

@ -269,12 +269,8 @@ struct OS2
if (c->plan->flags & HB_SUBSET_FLAGS_NO_PRUNE_UNICODE_RANGES)
return_trace (true);
/* when --gids option is not used, no need to do collect_mapping that is
* iterating all codepoints in each subtable, which is not efficient */
uint16_t min_cp, max_cp;
find_min_and_max_codepoint (&c->plan->unicodes, &min_cp, &max_cp);
os2_prime->usFirstCharIndex = min_cp;
os2_prime->usLastCharIndex = max_cp;
os2_prime->usFirstCharIndex = hb_min (0xFFFFu, c->plan->unicodes.get_min ());
os2_prime->usLastCharIndex = hb_min (0xFFFFu, c->plan->unicodes.get_max ());
_update_unicode_ranges (&c->plan->unicodes, os2_prime->ulUnicodeRange);
@ -311,14 +307,6 @@ struct OS2
ulUnicodeRange[i] = ulUnicodeRange[i] & newBits[i]; // set bits only if set in the original
}
static void find_min_and_max_codepoint (const hb_set_t *codepoints,
uint16_t *min_cp, /* OUT */
uint16_t *max_cp /* OUT */)
{
*min_cp = hb_min (0xFFFFu, codepoints->get_min ());
*max_cp = hb_min (0xFFFFu, codepoints->get_max ());
}
/* https://github.com/Microsoft/Font-Validator/blob/520aaae/OTFontFileVal/val_OS2.cs#L644-L681
* https://docs.microsoft.com/en-us/typography/legacy/legacy_arabic_fonts */
enum font_page_t