mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-07 21:23:32 +00:00
examples: added a default font for flawless test
This commit is contained in:
parent
75c9028c19
commit
8e1cd7b4c6
4 changed files with 12 additions and 3 deletions
|
@ -32,6 +32,9 @@ struct UserExample : tvgexam::Example
|
|||
|
||||
bool content(tvg::Canvas* canvas, uint32_t w, uint32_t h) override
|
||||
{
|
||||
//The default font for fallback in case
|
||||
tvg::Text::load(EXAMPLE_DIR"/font/Arial.ttf");
|
||||
|
||||
//Animation Controller
|
||||
animation = unique_ptr<tvg::Animation>(tvg::Animation::gen());
|
||||
auto picture = animation->picture();
|
||||
|
|
|
@ -93,6 +93,9 @@ struct UserExample : tvgexam::Example
|
|||
{
|
||||
if (!canvas) return false;
|
||||
|
||||
//The default font for fallback in case
|
||||
tvg::Text::load(EXAMPLE_DIR"/font/Arial.ttf");
|
||||
|
||||
//Background
|
||||
auto shape = tvg::Shape::gen();
|
||||
shape->appendRect(0, 0, w, h);
|
||||
|
|
|
@ -32,6 +32,9 @@ struct UserExample : tvgexam::Example
|
|||
{
|
||||
if (!canvas) return false;
|
||||
|
||||
//default font for fallback in case
|
||||
tvg::Text::load(EXAMPLE_DIR"/font/Arial.ttf");
|
||||
|
||||
//Background
|
||||
auto bg = tvg::Shape::gen();
|
||||
bg->appendRect(0, 0, w, h); //x, y, w, h
|
||||
|
|
|
@ -77,6 +77,9 @@ struct UserExample : tvgexam::Example
|
|||
{
|
||||
if (!canvas) return false;
|
||||
|
||||
//The default font for fallback in case
|
||||
tvg::Text::load(EXAMPLE_DIR"/font/Arial.ttf");
|
||||
|
||||
//Background
|
||||
auto shape = tvg::Shape::gen();
|
||||
shape->appendRect(0, 0, w, h);
|
||||
|
@ -84,9 +87,6 @@ struct UserExample : tvgexam::Example
|
|||
|
||||
canvas->push(shape);
|
||||
|
||||
//Default font
|
||||
if (!tvgexam::verify(tvg::Text::load(EXAMPLE_DIR"/font/Arial.ttf"))) return false;
|
||||
|
||||
this->w = w;
|
||||
this->h = h;
|
||||
this->size = w / NUM_PER_ROW;
|
||||
|
|
Loading…
Add table
Reference in a new issue