(librunview) Fix use of B_REGULAR_FACE if not default

This commit is contained in:
Jaidyn Ann 2021-07-25 11:37:17 -05:00
parent 5966df1a34
commit 0a0b29d349
2 changed files with 20 additions and 5 deletions

View File

@ -177,10 +177,8 @@ RunView::Select(int32 startOffset, int32 endOffset)
void
RunView::Append(const char* text, rgb_color color, uint16 fontFace)
RunView::Append(const char* text, rgb_color color, BFont font)
{
BFont font;
font.SetFace(fontFace);
text_run run = { 0, font, color };
text_run_array array = { 1, {run} };
@ -189,6 +187,22 @@ RunView::Append(const char* text, rgb_color color, uint16 fontFace)
}
void
RunView::Append(const char* text, rgb_color color, uint16 fontFace)
{
BFont font;
font.SetFace(fontFace);
Append(text, color, font);
}
void
RunView::Append(const char* text, rgb_color color)
{
Append(text, color, BFont());
}
void
RunView::Append(const char* text)
{

View File

@ -26,8 +26,9 @@ public:
virtual void Select(int32 startOffset, int32 endOffset);
void Append(const char* text, rgb_color color,
uint16 fontFace = B_REGULAR_FACE);
void Append(const char* text, rgb_color color, BFont font);
void Append(const char* text, rgb_color color, uint16 fontFace);
void Append(const char* text, rgb_color color);
void Append(const char* text);
BString WordAt(BPoint point);