Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use freetype #2110

Closed
wants to merge 3 commits into from
Closed

Use freetype #2110

wants to merge 3 commits into from

Conversation

PatriceJiang
Copy link
Contributor

No description provided.

@@ -0,0 +1,339 @@

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

文件的 license 缺失

#include "base/ccConfig.h"
#include <cassert>

#if CC_ENABLE_TTF_LABEL_RENDERER
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

如何使用这个宏?是通过编辑器配置得到吗?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

目前不是. 只在 ccConfig中配置.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

那加这个宏的意义是什么?如果手动关闭这个宏,会是什么效果。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

相当于移除freetype, 使用canvas渲染label

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

也就是说旧的实现还保留着?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

原先的 Label 在所有平台都是用 Canvas API 实现渲染的。现在的改动使得在 native 平台使用了Freetype + CustomAssembler,其他平台还是原来的 Canvas API。
如果关闭宏,相当于native上还原了改动, 使用之前的 Canvas API。

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

嗯,我的意思是有必要保留两套实现吗?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

是的。Canvas 绘制 Label 的逻辑是通用的,不能删除。

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不能删除的原因是什么?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

通用的Label 绘制逻辑是 js 层实现的, 如果删除 label 就无法绘制了,包括 web / 微信 等平台。之前 native 没有 label 的实现, 只是提供了 canvas 的 API。

@@ -5203,6 +5203,25 @@ static bool js_cocos2dx_spine_IkConstraint_setStretch(se::State& s)
}
SE_BIND_FUNC(js_cocos2dx_spine_IkConstraint_setStretch)

static bool js_cocos2dx_spine_IkConstraint_setActive(se::State& s)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

为什么会修改 spine 的绑定代码?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

应该是 master代码比较旧导致的

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

那你这部分不需要修改,让自动绑定代码去做。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@PatriceJiang PatriceJiang changed the title add freetype Use freetype Feb 14, 2020
@PatriceJiang PatriceJiang mentioned this pull request Feb 14, 2020
@PatriceJiang
Copy link
Contributor Author

reopen in #2125

@PatriceJiang PatriceJiang deleted the use-freetype4 branch June 15, 2020 07:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants