Commit Graph

145 Commits

Author SHA1 Message Date
newnon 88c3fcde67 Full unicode support (#17179)
* Full unicode support

* test for emoji
2017-02-06 16:41:52 +08:00
mogemimi 6e8ced6c8c Fix minor typos in function parameters (#17157) 2017-01-11 05:34:57 -08:00
effolkronium f5a90765fc fix type conversion warnings (#17061)
* Fix conversion warning

from unsigned int to float

* Fix type conversion warning

* Fix type conversion warning

* change the return type of getOutlineSize to float

* fix typo
2017-01-04 12:01:07 +08:00
James Chen 77cf6de2e5 [label] Fixes shadow is drawn incorrect while also enabling outline. (#17024) 2016-12-16 14:56:36 +08:00
James Chen b135d512d2 Update copyright to 2016. (#16311) 2016-08-05 09:42:15 +08:00
James Chen bf80f10dfd Remove unneeded std::bind, and use const & for input parameters. 2016-07-26 00:55:32 +08:00
zilongshanren f0f8663fa9 fix TTF and BMFont word wrap 2016-06-16 14:15:00 +08:00
Vladimir Perminov b3b047e9ad Label '\b' - Next char not change x position
Add TextFormatter for easy use '\n', '\r', '\b'
2016-03-07 14:07:36 +03:00
mogemimi 1d9e688707 Fix typos in documentation 2016-02-18 16:16:36 +09:00
Justin Luong bd4615795e fixed documentation for better reading clarity 2016-01-27 11:42:25 +10:00
Justin Luong c4df3ccd10 please ignore just a test 2016-01-22 11:05:43 +10:00
Ricardo Quesada 27c8e5227d Adds xml support in UIRichText
Supported tags:
- <small>: makes the font 20% smaller
- <big>: makes the font 25% bigger
- <img src="" />: to add an image
- <font face="path to font" size="size" color="#00ffaa">: font
  attributes
- <i>: italics
- <b>: bold
- <u>: underline
- <del> strike-through
- </br>: new line

Also adds support for strikethrough, italics, bold and underlie to
`Label`

Contains tests for UIRichText and Label

Squashed commit of the following:

commit a0d6ae0513d40dbf414930210ab032a49d8984a0
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Tue Jan 19 20:39:21 2016 -0800

    cleanup LabelTestNew

commit 0cf423af85d88a42fc1317207feeb3d05da7f8ab
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Tue Jan 19 20:34:53 2016 -0800

    adds maaaany tests

    ...and fixes width and height in <img src="">

commit e8ba6acd5d79bbc766d7aa02ef166e166c801d01
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Fri Jan 15 19:41:37 2016 -0800

    Label + URL working Ok

commit 36689e29ee3d77310e92264a09084cc06e30664c
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Fri Jan 15 18:24:44 2016 -0800

    adding this code just in case...

    ... should use a listener component instead

commit af03708950e74483b875d0baad593aa6ed242a04
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Thu Jan 14 20:23:36 2016 -0800

    URL node

    plus <de><u> and <a img

commit e3a4930b012c0b3756752dac6ffb5ad43d24ae99
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Wed Jan 13 18:42:18 2016 -0800

    strikethrough and underline implemented

    they support multiline and horizontal alignment as well
    includes test
    however vertical alignment might not work

commit 640ccf39f56e153db46785a61be7000e898174c7
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Tue Jan 12 18:14:57 2016 -0800

    bug fixes

commit 5e41fb76e91c571639585a609a255eb41797a302
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Tue Jan 12 16:47:20 2016 -0800

    adds italics and bold "disable test"

commit 202c5a45bb9c8ea160b9f6880ef858874e07814b
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Tue Jan 12 14:40:13 2016 -0800

    adds italics test

commit d1a8b421445053cc36860fc376f52692a3672dfe
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Mon Jan 11 20:53:23 2016 -0800

    italics is working ok

commit fdd02087fce920c27c2409301ec88685fe68085b
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Fri Jan 8 17:18:56 2016 -0800

    color, size and face working

commit c01bdef6b1d49f8805b69d4c162b74cd00c8f5b3
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Thu Jan 7 19:02:16 2016 -0800

    initial commit
2016-01-19 20:41:31 -08:00
mogemimi 41dd44c75d Fix some typos in docs 2016-01-11 19:23:05 +09:00
zilongshanren b45e96f77e fix indent issue 2016-01-05 10:20:05 +08:00
zilongshanren 100a119181 add overFlow enum to jsb and lua.
1. change clamp to 1 and shrink to 2
2016-01-04 21:43:37 +08:00
Liam 4c5c6e6d9b update for code format 2015-12-11 12:04:54 +08:00
Liam e92db43e14 update for text clone 2015-12-10 13:17:31 +08:00
zilongshanren 6c17ef4baf fix horizontal clamp and shrink issue 2015-12-07 18:13:03 +08:00
Ricardo Quesada 48523572b7 label JS fixes 2015-12-02 17:23:23 -08:00
zilongshanren 7676b1cb73 improve label layout logic 2015-11-23 17:47:30 +08:00
zilongshanren 7ee82f20fc fix getLetter crash issue.
1. make vertical clamp works in non-wrap mode.

2. make the lineHeight and letterSprite scale work correct.
2015-11-20 16:39:48 +08:00
zilongshanren 8c25749366 minor improvement 2015-11-20 10:54:05 +08:00
zilongshanren 19257d6120 Add Overflow feature char map font.
1. fix single line clamp.
2015-11-19 18:14:46 +08:00
zilongshanren ccdb2a75f9 Add Label Overflow and wrap option.
Squashed commit of the following:

commit 7176582def3686f78701f92ead4d0976bccd115d
Author: zilongshanren <guanghui8827@126.com>
Date:   Thu Nov 19 10:30:54 2015 +0800

    add char map font test

commit 7ea7c251ff549e4a74d5c5c3faa49893fe5defc4
Author: zilongshanren <guanghui8827@126.com>
Date:   Wed Nov 18 15:00:17 2015 +0800

    system font overflow is not supported

commit a02fe0c7f94692b95a0bfd6f194a94c4519cee3a
Author: zilongshanren <guanghui8827@126.com>
Date:   Wed Nov 18 11:04:15 2015 +0800

    add system font test

commit eb098da8b16f485c86929a9b2ba00a64068264e9
Author: zilongshanren <guanghui8827@126.com>
Date:   Tue Nov 17 10:29:35 2015 +0800

    Finish resize height mode

commit ca78ba35abdbacc23bf6f8315454ec0a356a6aca
Author: zilongshanren <guanghui8827@126.com>
Date:   Mon Nov 16 11:01:27 2015 +0800

    fix wrap issue

commit baf1a5e0dc3a08da0a13500aea5afc82017b054a
Author: zilongshanren <guanghui8827@126.com>
Date:   Sat Nov 14 08:28:57 2015 +0800

    horizontal shrink still has a issue

commit 7e8abc0990cdf299d23c8072c5c1d4aa561bf798
Author: zilongshanren <guanghui8827@126.com>
Date:   Fri Nov 13 11:42:34 2015 +0800

    finish shrink without wrap

commit c9c45bd1f304ba00a6f9a274fa5631659a075bc1
Author: zilongshanren <guanghui8827@126.com>
Date:   Fri Nov 13 10:09:46 2015 +0800

    update shrink

commit ad82010ea846679e4d1a09f5127be29ae2e6adae
Author: zilongshanren <guanghui8827@126.com>
Date:   Thu Nov 12 17:55:15 2015 +0800

    refactor shrink logic

commit effc1ee1cd9f06eaa4f46dd5c2a1401f6a285af6
Author: zilongshanren <guanghui8827@126.com>
Date:   Wed Nov 11 18:25:34 2015 +0800

    add resize overflow type

commit 194d552adc2a4ba2c439eff969b082556315e0ae
Author: zilongshanren <guanghui8827@126.com>
Date:   Wed Nov 11 11:49:51 2015 +0800

    no wrap, shrink is working.

commit e2222ef14d5392817bd727895b3c2caec5ce4faf
Author: zilongshanren <guanghui8827@126.com>
Date:   Tue Nov 10 16:16:27 2015 +0800

    add overflow type to label.

    1. optimize the testcase

commit b65e2de4bfb3cb86a0d0cfa118be891a3f9fe858
Author: zilongshanren <guanghui8827@126.com>
Date:   Mon Nov 9 17:22:34 2015 +0800

    finish bmfont wrap by char

commit f339ff0309dc9e2ca2871f03f4551d329afce5e1
Author: zilongshanren <guanghui8827@126.com>
Date:   Mon Nov 9 17:04:51 2015 +0800

    finish bmfont wrap by word

commit 4c8edc65204a1294ac81315e72f1299acbdf43c0
Author: zilongshanren <guanghui8827@126.com>
Date:   Mon Nov 9 11:29:21 2015 +0800

    add BMFont size support

commit 3282481bda9dcb0f88b41f2568f7e5c856af6d53
Author: zilongshanren <guanghui8827@126.com>
Date:   Mon Nov 9 09:58:01 2015 +0800

    add font size support for BMFONT

commit 0c8e2a0374983625507a183cb2eb53a0b1709e25
Author: zilongshanren <guanghui8827@126.com>
Date:   Fri Nov 6 16:36:27 2015 +0800

    add toggle wrap option.

    1. make hirozontal clamp working

commit 19dcd3e80a34c54b20934d08937eb270e689a7db
Author: zilongshanren <guanghui8827@126.com>
Date:   Fri Nov 6 15:12:59 2015 +0800

    tweak label layout

commit e36a40babf4817ea7e9830614ac7560f2e69c583
Author: zilongshanren <guanghui8827@126.com>
Date:   Thu Nov 5 11:11:02 2015 +0800

    finish the test skeleton

commit a144a3a5d388d15c4f37cbfc12563eccabffb8e1
Author: zilongshanren <guanghui8827@126.com>
Date:   Wed Nov 4 16:38:54 2015 +0800

    add setFontSize api to label.

    1. add new chinese-english bmfont
    2. beautify base test

commit b22551c9eb3738fbb1c38ae4a3bfd07a202dcaf0
Author: zilongshanren <guanghui8827@126.com>
Date:   Wed Nov 4 11:27:18 2015 +0800

    add label layout test skeleton
2015-11-19 16:06:13 +08:00
pandamicro 82881bf92f Merge pull request #14109 from loadrunner/label3
Added line spacing/leading feature to Label
2015-10-19 10:55:53 +08:00
Danut Chereches 471c23930c added line spacing/leading 2015-10-10 19:15:45 +03:00
Danut Chereches 019b549a20 changed font size type to float 2015-10-10 19:15:22 +03:00
WenhaiLin 827f05c5e1 Fixed `Label::setGlobalZOrder ` is invalid when label create with system font. 2015-08-19 10:22:48 +08:00
WenhaiLin c06994de34 Label:Fixed display incorrect if label content is changed after invoking `getLetter(letterIndex)` 2015-08-13 10:29:58 +08:00
WenhaiLin 2363622a67 Label:support auto batch with bitmap font or char map. 2015-08-04 21:49:14 +08:00
WenhaiLin 964e7103b5 Improve coding style 2015-07-30 11:33:18 +08:00
WenhaiLin a9f27865d3 Fixed the content size of Label is incorrect with GLOW effect. 2015-07-29 16:30:07 +08:00
WenhaiLin 37a174ee4a Label:refine the implementation about text layout and support debug draw 2015-07-24 18:38:45 +08:00
WenhaiLin 731de26795 Label:Fixed system font may be invisible when there are multiple cameras. 2015-07-17 17:45:11 +08:00
WenhaiLin d4f62a8063 Label:improving the code readability. 2015-07-14 11:30:56 +08:00
WenhaiLin 6a33702c80 Refine Label::onDraw 2015-07-08 17:59:24 +08:00
WenhaiLin 8cf27b9174 Update comments. 2015-07-08 15:30:34 +08:00
WenhaiLin 158d96046e Label:Support add child nodes. 2015-07-07 14:20:23 +08:00
Alex Peak 7cea464a11 Ensure CCLabel atlases are purged before resetting
The current purge->reset behavior occurs per label according to scene
graph priority.  This has two disadvanages; firstly, any labels that are
initialized but not part of the scene graph will not be reset.
Secondly, any labels which share atlases in the FontAtlasCache may not
be reset since each label will call releaseFontAtlas individually before
resetting its fontConfig.  This means that any shared atlases may not be
released all the way to a reference count of 0 and the invalid atlas
will not be deleted and reset from scratch.

By putting a fixed priority on both the purge and reset steps we can
ensure that firstly: all labels will be reset regardless of whether they
have been added to the scene-graph.  Secondly, ALL labels with the same
atlas must call releaseFontAtlas before any others are allowed to
rebuild their textures.  This will prevent any old atlases from sticking
around after a new GL context is created.

This is a fix for Github issue #8305
https://github.com/cocos2d/cocos2d-x/issues/8305
2015-06-30 13:16:25 -07:00
WenhaiLin 0ac99002d5 Label:disableEffect(LabelEffect::XXXX) support disable all effect. 2015-04-17 14:39:52 +08:00
andyque c8d8a0d220 add disableEffect API for ui::Text 2015-04-10 14:18:16 +08:00
WenhaiLin 927cda3f0d Add Label::disableEffect(LabelEffect effect) for better support disable the effect of Label. 2015-04-07 15:51:57 +08:00
WenhaiLin c5c5d3e39d Label: Fixed shadow color is incorrect. 2015-04-07 11:17:01 +08:00
VisualSJ 9ba82584a9 [ci skip] Add javascript notes...
cocos/2d/CCClippingNode.h
  cocos/2d/CCTMXTiledMap.h
  cocos/2d/CCTMXObjectGroup.h
  cocos/2d/CCTMXLayer.h
  cocos/2d/CCSpriteBatchNode.h
  cocos/2d/CCSprite.h
  cocos/2d/CCRenderTexture.h
  cocos/2d/CCProtectedNode.h
  cocos/2d/CCMenuItem.h
  cocos/2d/CCMenu.h
  cocos/2d/CCLabelAtlas.h
  cocos/2d/CCLabel.h
  cocos/2d/CCGrid.h
  cocos/2d/CCGLBufferedNode.h
  cocos/2d/CCFastTMXTiledMap.h
  cocos/2d/CCFastTMXLayer.h
  cocos/2d/CCDrawingPrimitives.h
  cocos/2d/CCDrawNode.h
  cocos/2d/CCComponentContainer.h
  cocos/2d/CCClippingRectangleNode.h
  cocos/2d/CCTextFieldTTF.h
  cocos/2d/CCTileMapAtlas.h
2015-03-28 14:28:16 +08:00
WenhaiLin 153d697f1a [ci skip]Update comments. 2015-03-25 10:59:04 +08:00
WenhaiLin 2caff4e64d [ci skip]Update comments 2015-03-24 14:12:58 +08:00
WenhaiLin e528531b4b [ci skip]Update document 2015-03-19 10:38:12 +08:00
yangxiao 5b26ba3c68 override setCameraMask 2015-03-16 17:11:17 +08:00
yangxiao f56d8c4784 fix camra mask for label does not work 2015-03-16 15:31:29 +08:00
WenhaiLin f2c6a48976 Fixed lose the precision of label's dimensions 2015-01-20 11:46:43 +08:00