| 39 | } |
| 40 | |
| 41 | Label::Label(String fontName, uint32_t fontSize, bool sdf) |
| 42 | : _alphaRef(0) |
| 43 | , _spacing(0) |
| 44 | , _textWidth(Label::AutomaticWidth) |
| 45 | , _lineGap(0.0f) |
| 46 | , _fontScale(GetFontScale(fontSize, sdf)) |
| 47 | , _alignment(TextAlign::Center) |
| 48 | , _outlineColor(0x0) |
| 49 | , _outlineWidth(0.0f) |
| 50 | , _smooth{sdf::sdf_gen2d::suggested_edge_x, sdf::sdf_gen2d::suggested_edge_y} |
| 51 | , _font(SharedFontCache.load(fontName, fontSize, sdf)) |
| 52 | , _blendFunc(BlendFunc::Default) |
| 53 | , _effect(sdf ? SharedFontCache.getSDFEffect() : SharedFontCache.getDefaultEffect()) { |
| 54 | if (_font) { |
| 55 | _lineGap = _font->getInfo().lineGap * _fontScale; |
| 56 | _flags.setOff(Node::TraverseEnabled); |
| 57 | _flags.setOn(Label::TextBatched); |
| 58 | } |
| 59 | } |
| 60 | |
| 61 | Label::Label(String fontStr) |
| 62 | : _alphaRef(0) |
no test coverage detected