Commit Graph

94 Commits

Author SHA1 Message Date
halx99 bafcac20c1 Add some comment for pr #384 2021-06-17 21:56:38 +08:00
RH d052cc8a48
Use TTF scaled metrics to calculate line height (#384) 2021-06-17 21:15:50 +08:00
RH d17e7b442a
FileStream::size() implemented (#365)
* Add FileStream::size()
Add ZipFile::zfsize()

* Use FileStream::size()
2021-05-31 15:08:44 +08:00
rh101 19995f863b Get the raw pointer on creation of the FileStream to avoid any accidental usage of the unique_ptr. 2021-04-26 17:31:34 +10:00
rh101 ef6bedd069 Use unique_ptr for FileUtils::openFileStream
Fix OGG audio playback due to incorrect tell() method
Fix unzip close() override method not deleting FileStream pointer.
2021-04-26 14:21:56 +10:00
rh101 bcafad58ea Ensure code uses FileStream::tell() to get size if required after using FileStream::seek(0, SET_END) 2021-04-26 10:28:33 +10:00
rh101 e1a9141a00 openFileStream now returns a nullptr if it fails 2021-04-24 09:22:27 +10:00
rh101 5b3b0989b4 Remove redundant std::move 2021-04-23 22:00:33 +10:00
rh101 8de1099614 Add support for virtual file system via custom FileStream and FileUtils implementations. 2021-04-22 03:15:49 +10:00
halx99 d4aa6900c3 By default, disable stream parsing 2020-08-27 11:40:44 +08:00
halx99 bf3a608c01 freetype stream parsing support, reduce memory use on FontCache 2020-08-27 11:35:55 +08:00
halx99 f88dfdc167 FreeType: Output missing char in .ttf at _DEBUG compiling mode 2020-08-12 14:24:06 +08:00
minggo c9af873e2e
fix some warnings (#20247) 2019-10-25 16:40:30 +08:00
coulsonwang c7020fbb5f fix C4244 warning (#20173) 2019-10-09 17:50:32 +08:00
Peter Siegmund bac694dc55 fix reorder warning (#18819) 2018-05-14 10:34:56 +08:00
leeda 18a6d8241d update Copyright. might need manual fix later (#18659)
* Copyright use python script updated. might be fix by manual later

* Revert "Copyright use python script updated. might be fix by manual later"

This reverts commit 49e99418e4da1fd02afda448ddeb16210f5e8c71.

* re modify copyright, consider utf-8-sig encoding

* another situation, add Copyright before  "Permission is hereby granted"

* Revert "another situation, add Copyright before  "Permission is hereby granted""

This reverts commit ee82591d32353c7ce2e146fe51ef447433b47571.

* another situation, add Copyright before Permission is hereby granted

* change "Copyright (c) 2016-2016 Chukong Technologies Inc." to " Copyright (c) 2016 Chukong Technologies Inc."

* script modify copyright, consider is cocos copyright or not

* change "Copyright (c) 2017 Chukong Technologies Inc." to "Copyright (c) 2016 Chukong Technologies Inc."

* manual fix, not fix audio related

* change "2016-2016" to "2016"
2018-01-29 16:25:32 +08:00
will 966483be30 fix memory leak in FontFreeType::create (#18503) 2017-11-30 16:45:48 +08:00
minggo 4be6eb5325 correct usage of reference count of LabelAtlas (#18117) 2017-07-31 09:05:55 +08:00
CocosRobot d07794052f Update license to 2017 (#17362)
* Typo: CopyRight -> Copyright

* Copyright update: chukong-inc.com -> Chukong Technologies Inc.

* [js files] Copyright update: 2014 -> 2014-2017

* [cpp files] Copyright update: 2014 -> 2014-2017

* Copyright update: 2015 -> 2015-2017

* [js files] Copyright update: 2014 -> 2014-2017

* Copyright update: 2016 -> 2016-2017

* Copyright update: 2013 -> 2013-2017

* Copyright update: 201?-201? -> 201?-2017

* License year fixes.

* Liscene year fix in CCRay.cpp

* Updates license years in CCGLProgramState.h & CCGLProgramStateCache.h
2017-02-14 14:36:57 +08:00
newnon f408cbfcca fix rendering font with not null line gap (#17175)
* fix rendering font with not null line gap

* test for line gap fix
2017-02-13 13:58:32 +08:00
newnon 88c3fcde67 Full unicode support (#17179)
* Full unicode support

* test for emoji
2017-02-06 16:41:52 +08:00
newnon e33cc3b257 fix when new is zero (#17283) 2017-02-06 15:17:18 +08:00
newnon 15e56c06a4 outline to float (#17176) 2017-01-13 14:31:12 +08:00
James Chen 627eba6aac fixed #16652: FontFreeType crashes in its destructor. (#16684) 2016-10-14 17:49:36 +08:00
minggo 84a102edf8 merge v3.13.1 back to v3 2016-09-15 10:08:28 +08:00
minggo 86de22a008 fix crash if FontAtlas pointer is the same (#16555) 2016-09-09 11:39:00 +08:00
Nakhyun Choi a9898b9875 possible memory leak when font size is 0 (#16424) 2016-08-24 18:27:44 -07:00
James Chen b135d512d2 Update copyright to 2016. (#16311) 2016-08-05 09:42:15 +08:00
Wenhai Lin a93cbe8a32 Refine 'CCFontXXXX' 2016-03-24 23:05:22 +08:00
Xpol Wan 90456d29ba Fixes 1605 include path in 541 files
using the tools/coding-style/include-linter.py with -f options.
2016-03-20 21:53:44 +08:00
zilongshanren e1e87c0205 Merge pull request #14914 from steerlink/font_family
Add ability to get the font family
2016-01-21 10:34:13 +08:00
Ricardo Quesada 86e8f7d0b3 oops... removing debugging code 2016-01-19 20:46:57 -08: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
sheldon.teerlink 535dfdac27 Fix warning. 2016-01-19 11:47:18 -07:00
sheldon.teerlink 41d7a27485 Implement getFontFamily(). 2016-01-19 11:43:35 -07:00
Wenhai Lin 4fa58602a8 Adds `std::nothrow` to the `new` statements 2015-12-16 14:02:55 +08:00
XiaoFeng d47a79c0e4 Remove cocos studio limitation for new functions 2015-11-16 11:08:20 +08:00
XiaoFeng c40a2a3301 Combine Studio change for 2d components 2015-11-12 09:49:49 +08:00
pandamicro b19bf82170 Merge pull request #14108 from loadrunner/label2
Changed label font size type to float
2015-10-13 11:55:14 +08:00
Danut Chereches 019b549a20 changed font size type to float 2015-10-10 19:15:22 +03:00
dimon4eg 09b5b7fcc3 Fix crash in destructor of FontFreeType 2015-09-21 18:18:58 +03:00
WenhaiLin e81d5af12d Spaces should not be lost if label created with Fingerpop.ttf 2015-08-05 23:46:41 +08:00
WenhaiLin 964e7103b5 Improve coding style 2015-07-30 11:33:18 +08:00
WenhaiLin 9edd66d4a7 Label:support font that contains GB2312 char map. 2015-07-28 16:28:32 +08:00
WenhaiLin 37a174ee4a Label:refine the implementation about text layout and support debug draw 2015-07-24 18:38:45 +08:00
WenhaiLin 81bc0b09da Label:Fixed create fail if the font(TTF) not contain a Unicode charmap. 2015-07-10 14:39:21 +08:00
WenhaiLin 322bd30d7b Label:Fixed the top of character's texture may be tailored if enable outline effect. 2015-07-01 14:57:01 +08:00
Wenhai Lin cbd428f6ac Label:Fixed wrong letter spacing with outline enabled 2015-06-17 13:57:23 +08:00
WenhaiLin 7e0dc7482b Label:Fixed the characters with outline not on the same base line. 2015-05-11 18:05:03 +08:00
WenhaiLin b1803d40db Label:Fixed outline doesn't match with the characters exactly. 2015-05-06 17:17:30 +08:00