Test for font family on mac using NSFontManager::availableFontsForFamily

On Mac OS 10.15 Catalina, NSFontManager::availableFamilies does not list
"Hiragino Kaku Gothic ProN" any more but only lists it as "Hiragino
Sans". However, NSFontManager::availableFontsForFamily still shows
results when searching for this name. Use this as a workaround for
finding a result for the standard "sans-serif" Japanese font that is
stored in the preferences, which is "Hiragino Kaku Gothic ProN", until
we update this font matching code to be only CoreText based.

Since the previous code mentions enumerating families being essential
for performing case-insensitive comparisons, add a test to ensure that
the new API actually performs case-insensitive matches on all Mac OS
versions (at this point back to 10.10) that we support.

Bug: 1000542
Change-Id: I43aac2ce74cdc40a50d11ff075bad71a7e7a5d38
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1872055
Commit-Queue: Emil A Eklund <eae@chromium.org>
Reviewed-by: Emil A Eklund <eae@chromium.org>
Reviewed-by: Ben Wagner <bungeman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#708317}
4 files changed