From 966ca54d9725ad46ebec09e25cfeb26044d5dc7e Mon Sep 17 00:00:00 2001 From: weixin_43271254 Date: Thu, 17 Jul 2025 23:35:29 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=82=E9=85=8D=E5=A4=9A=E8=AE=BE=E5=A4=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: weixin_43271254 Change-Id: Ie003e6abd6b11c1b4eea5701185f5edda336b07b --- .../core/components_ng/pattern/search/search_pattern.cpp | 4 +++- .../components_ng/pattern/text_field/text_field_pattern.cpp | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/frameworks/core/components_ng/pattern/search/search_pattern.cpp b/frameworks/core/components_ng/pattern/search/search_pattern.cpp index 93010d1a198..d91eb9f52d0 100644 --- a/frameworks/core/components_ng/pattern/search/search_pattern.cpp +++ b/frameworks/core/components_ng/pattern/search/search_pattern.cpp @@ -1703,7 +1703,9 @@ void SearchPattern::ToJsonValueForTextField(std::unique_ptr& json, co "fontSize", textFieldLayoutProperty->GetFontSizeValue(searchTheme->GetFontSize()).ToString().c_str()); textFontJson->Put("fontStyle", textFieldPattern->GetItalicFontStyle() == Ace::FontStyle::NORMAL ? "FontStyle.Normal" : "FontStyle.Italic"); - textFontJson->Put("fontWeight", V2::ConvertWrapFontWeightToStirng(textFieldPattern->GetFontWeight()).c_str()); + textFontJson->Put("fontWeight", + V2::ConvertWrapFontWeightToStirng(textFieldLayoutProperty->GetFontWeightValue(searchTheme->GetFontWeight())) + .c_str()); textFontJson->Put("fontFamily", textFieldPattern->GetFontFamily().c_str()); json->PutExtAttr("textFont", textFontJson->ToString().c_str(), filter); json->PutExtAttr("copyOption", diff --git a/frameworks/core/components_ng/pattern/text_field/text_field_pattern.cpp b/frameworks/core/components_ng/pattern/text_field/text_field_pattern.cpp index e5426ffa654..ea64673c8ef 100644 --- a/frameworks/core/components_ng/pattern/text_field/text_field_pattern.cpp +++ b/frameworks/core/components_ng/pattern/text_field/text_field_pattern.cpp @@ -7018,7 +7018,7 @@ std::string TextFieldPattern::GetPlaceholderFont() const jsonValue->Put("weight", "900"); break; default: - jsonValue->Put("fontWeight", V2::ConvertWrapFontWeightToStirng(weight).c_str()); + jsonValue->Put("weight", V2::ConvertWrapFontWeightToStirng(weight).c_str()); } auto family = layoutProperty->GetPlaceholderFontFamilyValue({ "sans-serif" }); std::string jsonFamily = ConvertFontFamily(family); -- Gitee