mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 04:27:45 +00:00
LibGfx: Rename TTF/TrueType to OpenType
OpenType is the backwards-compatible successor to TrueType, and the format we're actually parsing in LibGfx. So let's call it that.
This commit is contained in:
parent
ed84a6f6ee
commit
f982400063
15 changed files with 40 additions and 40 deletions
|
@ -4,7 +4,7 @@
|
|||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibGfx/Font/TrueType/Cmap.h>
|
||||
#include <LibGfx/Font/OpenType/Cmap.h>
|
||||
#include <LibTest/TestCase.h>
|
||||
|
||||
TEST_CASE(test_cmap_format_4)
|
||||
|
@ -54,7 +54,7 @@ TEST_CASE(test_cmap_format_4)
|
|||
0, 0,
|
||||
};
|
||||
// clang-format on
|
||||
auto cmap = TTF::Cmap::from_slice({ cmap_table, sizeof cmap_table }).value();
|
||||
auto cmap = OpenType::Cmap::from_slice({ cmap_table, sizeof cmap_table }).value();
|
||||
cmap.set_active_index(0);
|
||||
|
||||
// Format 4 can't handle code points > 0xffff.
|
||||
|
@ -74,7 +74,7 @@ TEST_CASE(test_cmap_format_4)
|
|||
// From https://docs.microsoft.com/en-us/typography/opentype/spec/cmap#format-4-segment-mapping-to-delta-values:
|
||||
// "the final start code and endCode values must be 0xFFFF. This segment need not contain any valid mappings.
|
||||
// (It can just map the single character code 0xFFFF to missingGlyph). However, the segment must be present."
|
||||
// FIXME: Make TTF::Cmap::from_slice() reject inputs where this isn't true.
|
||||
// FIXME: Make OpenType::Cmap::from_slice() reject inputs where this isn't true.
|
||||
EXPECT_EQ(cmap.glyph_id_for_code_point(0xfeff), 0u);
|
||||
EXPECT_EQ(cmap.glyph_id_for_code_point(0xffff), 0xffffu);
|
||||
EXPECT_EQ(cmap.glyph_id_for_code_point(0x1'0000), 0u);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue