|
@@ -517,6 +517,9 @@ ErrorOr<NonnullRefPtr<Font>> Font::try_load_from_offset(ReadonlyBytes buffer, u3
|
|
|
if (!platform.has_value())
|
|
|
return Error::from_string_literal("Invalid Platform ID");
|
|
|
|
|
|
+ /* NOTE: The encoding records are sorted first by platform ID, then by encoding ID.
|
|
|
+ This means that the Windows platform will take precedence over Macintosh, which is
|
|
|
+ usually what we want here. */
|
|
|
if (platform.value() == Cmap::Subtable::Platform::Windows) {
|
|
|
if (subtable.encoding_id() == (u16)Cmap::Subtable::WindowsEncoding::UnicodeFullRepertoire) {
|
|
|
cmap.set_active_index(i);
|
|
@@ -528,7 +531,6 @@ ErrorOr<NonnullRefPtr<Font>> Font::try_load_from_offset(ReadonlyBytes buffer, u3
|
|
|
}
|
|
|
} else if (platform.value() == Cmap::Subtable::Platform::Macintosh) {
|
|
|
cmap.set_active_index(i);
|
|
|
- break;
|
|
|
}
|
|
|
}
|
|
|
|