mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 19:38:12 +00:00
LibGfx: Remove infallible BitmapFont::create() factory function
This was only used in TestFontHandling. So, let's remove it, and use the "create" name for the fallible one.
This commit is contained in:
parent
2f26a7bb12
commit
a1c24ef3ad
4 changed files with 11 additions and 17 deletions
|
@ -61,12 +61,7 @@ ErrorOr<NonnullRefPtr<Font>> BitmapFont::try_clone() const
|
|||
return TRY(adopt_nonnull_ref_or_enomem(new (nothrow) BitmapFont(m_name, m_family, new_rows, new_widths, m_fixed_width, m_glyph_width, m_glyph_height, m_glyph_spacing, m_range_mask_size, new_range_mask, m_baseline, m_mean_line, m_presentation_size, m_weight, m_slope, true)));
|
||||
}
|
||||
|
||||
NonnullRefPtr<BitmapFont> BitmapFont::create(u8 glyph_height, u8 glyph_width, bool fixed, size_t glyph_count)
|
||||
{
|
||||
return MUST(try_create(glyph_height, glyph_width, fixed, glyph_count));
|
||||
}
|
||||
|
||||
ErrorOr<NonnullRefPtr<BitmapFont>> BitmapFont::try_create(u8 glyph_height, u8 glyph_width, bool fixed, size_t glyph_count)
|
||||
ErrorOr<NonnullRefPtr<BitmapFont>> BitmapFont::create(u8 glyph_height, u8 glyph_width, bool fixed, size_t glyph_count)
|
||||
{
|
||||
glyph_count += 256 - (glyph_count % 256);
|
||||
glyph_count = min(glyph_count, s_max_glyph_count);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue