1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 18:17:44 +00:00

Everywhere: codepoint => code point

This commit is contained in:
Andreas Kling 2021-06-01 10:01:11 +02:00
parent a8ae8b24de
commit 12a42edd13
18 changed files with 240 additions and 240 deletions

View file

@ -501,7 +501,7 @@ bool Font::is_fixed_width() const
{
// FIXME: Read this information from the font file itself.
// FIXME: Although, it appears some application do similar hacks
return glyph_metrics(glyph_id_for_codepoint('.'), 1, 1).advance_width == glyph_metrics(glyph_id_for_codepoint('X'), 1, 1).advance_width;
return glyph_metrics(glyph_id_for_code_point('.'), 1, 1).advance_width == glyph_metrics(glyph_id_for_code_point('X'), 1, 1).advance_width;
}
int ScaledFont::width(const StringView& string) const
@ -513,8 +513,8 @@ int ScaledFont::width(const StringView& string) const
int ScaledFont::width(const Utf8View& utf8) const
{
int width = 0;
for (u32 codepoint : utf8) {
u32 glyph_id = glyph_id_for_codepoint(codepoint);
for (u32 code_point : utf8) {
u32 glyph_id = glyph_id_for_code_point(code_point);
auto metrics = glyph_metrics(glyph_id);
width += metrics.advance_width;
}
@ -525,7 +525,7 @@ int ScaledFont::width(const Utf32View& utf32) const
{
int width = 0;
for (size_t i = 0; i < utf32.length(); i++) {
u32 glyph_id = glyph_id_for_codepoint(utf32.code_points()[i]);
u32 glyph_id = glyph_id_for_code_point(utf32.code_points()[i]);
auto metrics = glyph_metrics(glyph_id);
width += metrics.advance_width;
}
@ -545,7 +545,7 @@ RefPtr<Gfx::Bitmap> ScaledFont::raster_glyph(u32 glyph_id) const
Gfx::Glyph ScaledFont::glyph(u32 code_point) const
{
auto id = glyph_id_for_codepoint(code_point);
auto id = glyph_id_for_code_point(code_point);
auto bitmap = raster_glyph(id);
auto metrics = glyph_metrics(id);
return Gfx::Glyph(bitmap, metrics.left_side_bearing, metrics.advance_width, metrics.ascender);
@ -553,21 +553,21 @@ Gfx::Glyph ScaledFont::glyph(u32 code_point) const
u8 ScaledFont::glyph_width(size_t code_point) const
{
auto id = glyph_id_for_codepoint(code_point);
auto id = glyph_id_for_code_point(code_point);
auto metrics = glyph_metrics(id);
return metrics.advance_width;
}
int ScaledFont::glyph_or_emoji_width(u32 code_point) const
{
auto id = glyph_id_for_codepoint(code_point);
auto id = glyph_id_for_code_point(code_point);
auto metrics = glyph_metrics(id);
return metrics.advance_width;
}
u8 ScaledFont::glyph_fixed_width() const
{
return glyph_metrics(glyph_id_for_codepoint(' ')).advance_width;
return glyph_metrics(glyph_id_for_code_point(' ')).advance_width;
}
}