PuzzleSDK
FontTest.h
浏览该文件的文档.
1/****************************************************************************
2 Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.
3
4 http://www.cocos2d-x.org
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to deal
8 in the Software without restriction, including without limitation the rights
9 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 THE SOFTWARE.
23 ****************************************************************************/
24
25#ifndef _FONT_TEST_H_
26#define _FONT_TEST_H_
27
28#include "cocos2d.h"
29#include "../BaseTest.h"
30
32
33class FontTest : public TestCase
34{
35public:
36 static FontTest* create(const std::string& fontFile)
37 {
38 auto ret = new (std::nothrow) FontTest;
39 if (ret && ret->init())
40 {
41 ret->showFont(fontFile);
42 ret->autorelease();
43 }
44 else
45 {
46 delete ret;
47 ret = nullptr;
48 }
49
50 return ret;
51 }
52
53 void showFont(const std::string& fontFile);
54
55 virtual std::string title() const override;
56};
57
59{
60public:
63 virtual void onEnter() override;
64 virtual std::string title() const override;
65protected:
67
69};
70
72{
73public:
75 virtual std::string title() const override;
76protected:
78};
79
80#endif // _FONT_TEST_H_
DEFINE_TEST_SUITE(FontTests)
virtual std::string title() const override
Definition: FontTest.cpp:252
virtual void onEnter() override
Definition: FontTest.cpp:180
static FontNoReplacementTest * create()
Definition: FontTest.cpp:145
static FontReplacementTest * create()
Definition: FontTest.cpp:257
virtual std::string title() const override
Definition: FontTest.cpp:278
static FontTest * create(const std::string &fontFile)
Definition: FontTest.h:36
void showFont(const std::string &fontFile)
Definition: FontTest.cpp:83
virtual std::string title() const override
Definition: FontTest.cpp:140