mirror of
https://gitee.com/openharmony/arkui_ace_engine
synced 2024-11-23 07:01:24 +00:00
!47554 添加字体粗细不跟随系统字体粗细变化而变化功能
Merge pull request !47554 from s30034929/master
This commit is contained in:
commit
df06b08103
@ -1492,11 +1492,12 @@ std::shared_ptr<Rosen::RSSurfaceNode> UIContentImpl::GetFormRootNode()
|
||||
void UIContentImpl::SetFontScaleAndWeightScale(const RefPtr<Platform::AceContainer>& container, int32_t instanceId)
|
||||
{
|
||||
float fontScale = SystemProperties::GetFontScale();
|
||||
float fontWeightScale = SystemProperties::GetFontWeightScale();
|
||||
if (isFormRender_ && !fontScaleFollowSystem_) {
|
||||
TAG_LOGW(AceLogTag::ACE_FORM, "setFontScale form default size");
|
||||
fontScale = 1.0f;
|
||||
fontWeightScale = 1.0f;
|
||||
}
|
||||
float fontWeightScale = SystemProperties::GetFontWeightScale();
|
||||
container->SetFontScale(instanceId, fontScale);
|
||||
container->SetFontWeightScale(instanceId, fontWeightScale);
|
||||
}
|
||||
@ -2436,10 +2437,11 @@ void BuildParsedConfig(Platform::ParsedConfig& parsedConfig,
|
||||
// EtsCard Font followSytem disable
|
||||
if (formFontUseDefault) {
|
||||
parsedConfig.fontScale = "1.0";
|
||||
parsedConfig.fontWeightScale = "1.0";
|
||||
} else {
|
||||
parsedConfig.fontScale = config->GetItem(OHOS::AAFwk::GlobalConfigurationKey::SYSTEM_FONT_SIZE_SCALE);
|
||||
parsedConfig.fontWeightScale = config->GetItem(OHOS::AAFwk::GlobalConfigurationKey::SYSTEM_FONT_WEIGHT_SCALE);
|
||||
}
|
||||
parsedConfig.fontWeightScale = config->GetItem(OHOS::AAFwk::GlobalConfigurationKey::SYSTEM_FONT_WEIGHT_SCALE);
|
||||
}
|
||||
|
||||
void UIContentImpl::UpdateConfiguration(const std::shared_ptr<OHOS::AppExecFwk::Configuration>& config)
|
||||
|
Loading…
Reference in New Issue
Block a user