From c2d758eea4df581390a0f26214b84de8b6c603f3 Mon Sep 17 00:00:00 2001 From: oh_ci Date: Sat, 16 Aug 2025 06:09:11 +0000 Subject: [PATCH] =?UTF-8?q?=E5=9B=9E=E9=80=80=20'Pull=20Request=20!2027=20?= =?UTF-8?q?:=20=E4=BC=98=E5=8C=96=E5=AD=97=E4=BD=93=E5=BC=95=E6=93=8E?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E4=BB=A3=E7=A0=81'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- m133/include/core/SkTypeface.h | 2 +- m133/modules/skparagraph/include/Paragraph.h | 2 +- m133/modules/skparagraph/src/OneLineShaper.cpp | 2 ++ m133/modules/skparagraph/src/ParagraphCache.cpp | 2 +- m133/modules/skparagraph/src/Run.cpp | 3 +-- m133/modules/skparagraph/src/TextLine.cpp | 3 +-- m133/src/ports/skia_ohos/FontConfig_ohos.h | 1 - m133/src/ports/skia_ohos/SkFontMgr_ohos.h | 11 ++++++++--- 8 files changed, 15 insertions(+), 11 deletions(-) diff --git a/m133/include/core/SkTypeface.h b/m133/include/core/SkTypeface.h index 62f0c610ea..4f38452105 100644 --- a/m133/include/core/SkTypeface.h +++ b/m133/include/core/SkTypeface.h @@ -113,7 +113,7 @@ public: /** Creates a new reference to the typeface that most closely matches the requested familyName and fontStyle. This method allows extended font - face specifiers as in the SkFontStyle type. + face specifiers as in the SkFontStyle type. Will never return null. @param familyName May be NULL. The name of the font family. @param fontStyle The style of the typeface. diff --git a/m133/modules/skparagraph/include/Paragraph.h b/m133/modules/skparagraph/include/Paragraph.h index 0bcc0d5b62..9cf2cd9c09 100644 --- a/m133/modules/skparagraph/include/Paragraph.h +++ b/m133/modules/skparagraph/include/Paragraph.h @@ -34,7 +34,7 @@ enum InternalState { kDrawn = 7 }; -enum class UtfEncodeType { +enum UtfEncodeType { kUtf8, kUtf16 }; diff --git a/m133/modules/skparagraph/src/OneLineShaper.cpp b/m133/modules/skparagraph/src/OneLineShaper.cpp index fa6eda6219..ce0b62fbd3 100644 --- a/m133/modules/skparagraph/src/OneLineShaper.cpp +++ b/m133/modules/skparagraph/src/OneLineShaper.cpp @@ -7,6 +7,8 @@ #ifdef ENABLE_TEXT_ENHANCE #include "src/Run.h" #include "include/TextGlobalConfig.h" +#include "include/TextStyle.h" +#include "SkScalar.h" #include "trace.h" #endif diff --git a/m133/modules/skparagraph/src/ParagraphCache.cpp b/m133/modules/skparagraph/src/ParagraphCache.cpp index 7e35661dae..2944b6cfd9 100644 --- a/m133/modules/skparagraph/src/ParagraphCache.cpp +++ b/m133/modules/skparagraph/src/ParagraphCache.cpp @@ -473,7 +473,7 @@ void ParagraphCache::SetStoredLayoutImpl(ParagraphImpl& paragraph, ParagraphCach paragraph.getIntrinsicSize(value->fMaxIntrinsicWidth, value->fMinIntrinsicWidth, value->fAlphabeticBaseline, value->fIdeographicBaseline, value->fExceededMaxLines); - for (auto& indent : paragraph.fIndents) { + for (auto& indent : value->indents) { value->indents.push_back(indent); } value->linebreakStrategy = paragraph.getLineBreakStrategy(); diff --git a/m133/modules/skparagraph/src/Run.cpp b/m133/modules/skparagraph/src/Run.cpp index 7596fb61c4..0569131e4a 100644 --- a/m133/modules/skparagraph/src/Run.cpp +++ b/m133/modules/skparagraph/src/Run.cpp @@ -692,8 +692,7 @@ void Run::updateMetrics(InternalLineMetrics* endlineMetrics) { fFontMetrics.fLeading = 0; - updatePlaceholderAlignmentIfNeeded(placeholderStyle->fAlignment, - fOwner->getParagraphStyle().getVerticalAlignment()); + updatePlaceholderAlignmentIfNeeded(placeholderStyle->fAlignment, fOwner->getParagraphStyle().getVerticalAlignment()); switch (placeholderStyle->fAlignment) { case PlaceholderAlignment::kBaseline: diff --git a/m133/modules/skparagraph/src/TextLine.cpp b/m133/modules/skparagraph/src/TextLine.cpp index 6a849f3c04..d02c063e71 100644 --- a/m133/modules/skparagraph/src/TextLine.cpp +++ b/m133/modules/skparagraph/src/TextLine.cpp @@ -1364,8 +1364,7 @@ void TextLine::middleEllipsisUpdateLine(ClusterIndex& startIndex, ClusterIndex& { const Cluster& startCluster = fOwner->cluster(startIndex); const Cluster& endCluster = fOwner->cluster(endIndex); - fEllipsis->fTextRange = TextRange(startCluster.textRange().start, - startCluster.textRange().start + fEllipsis->size()); + fEllipsis->fTextRange = TextRange(startCluster.textRange().start, startCluster.textRange().start + fEllipsis->size()); fEllipsis->setOwner(fOwner); fEllipsis->fClusterStart = startCluster.textRange().start; fEllipsisIndex = startCluster.runIndex(); diff --git a/m133/src/ports/skia_ohos/FontConfig_ohos.h b/m133/src/ports/skia_ohos/FontConfig_ohos.h index 46c6d2990d..4823844200 100644 --- a/m133/src/ports/skia_ohos/FontConfig_ohos.h +++ b/m133/src/ports/skia_ohos/FontConfig_ohos.h @@ -9,7 +9,6 @@ #include #include #include -#include #include "FontInfo_ohos.h" #include "HmSymbolConfig_ohos.h" diff --git a/m133/src/ports/skia_ohos/SkFontMgr_ohos.h b/m133/src/ports/skia_ohos/SkFontMgr_ohos.h index 153786fe69..6c58ed2e87 100644 --- a/m133/src/ports/skia_ohos/SkFontMgr_ohos.h +++ b/m133/src/ports/skia_ohos/SkFontMgr_ohos.h @@ -1,6 +1,11 @@ -// Copyright (c) 2023 Huawei Device Co., Ltd. All rights reserved -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. +/* + * Copyright 2015 Google Inc. + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + * 2023.4.23 SkFontMgr on ohos. + * Copyright (c) 2023 Huawei Device Co., Ltd. All rights reserved. + */ #ifndef SKFONTMGR_OHOS_H #define SKFONTMGR_OHOS_H -- Gitee