Skip to content

Commit

Permalink
LibGfx: Use size_t instead of int for glyph count
Browse files Browse the repository at this point in the history
The count is always non-negative
  • Loading branch information
IdanHo authored and awesomekling committed Apr 18, 2021
1 parent c1971df commit 3c894d1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Userland/Libraries/LibGfx/BitmapFont.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ class BitmapFont : public Font {
m_glyph_widths[ch] = width;
}

int glyph_count() const { return m_glyph_count; }
size_t glyph_count() const { return m_glyph_count; }

FontTypes type() { return m_type; }
void set_type(FontTypes type);
Expand Down
2 changes: 1 addition & 1 deletion Userland/Libraries/LibGfx/Font.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ class Font : public RefCounted<Font> {

virtual u8 glyph_spacing() const = 0;

virtual int glyph_count() const = 0;
virtual size_t glyph_count() const = 0;

virtual String family() const = 0;
virtual String variant() const = 0;
Expand Down
2 changes: 1 addition & 1 deletion Userland/Libraries/LibTTF/Font.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ class ScaledFont : public Gfx::Font {
virtual String name() const override { return String::formatted("{} {}", family(), variant()); }
virtual bool is_fixed_width() const override { return m_font->is_fixed_width(); }
virtual u8 glyph_spacing() const override { return m_x_scale; } // FIXME: Read from font
virtual int glyph_count() const override { return m_font->glyph_count(); }
virtual size_t glyph_count() const override { return m_font->glyph_count(); }
virtual String family() const override { return m_font->family(); }
virtual String variant() const override { return m_font->variant(); }
virtual String qualified_name() const override { return String::formatted("{} {} {}", family(), presentation_size(), weight()); }
Expand Down

0 comments on commit 3c894d1

Please sign in to comment.