Build your own AI office with Univer Office SDK. Bring editing, calculation, collaboration, and file processing into your product for people and AI agents. Built on an extensible open-source core.
TypeScript boardcollaborationdocdocxexceloffce365officepdfpptpptxpresentationsdksheetslidesspreadsheetuniverwordwordprocessorworkspacexlsx
fix: punctuation adjustment issues in slide (#1690)
Ran Luo15cb6df4f022
diff --git a/packages/engine-render/src/components/docs/layout/block/paragraph/line-adjustment.ts b/packages/engine-render/src/components/docs/layout/block/paragraph/line-adjustment.tsindex df2cb09630..33b89f1753 100644--- a/packages/engine-render/src/components/docs/layout/block/paragraph/line-adjustment.ts+++ b/packages/engine-render/src/components/docs/layout/block/paragraph/line-adjustment.ts@@ -208,8 +208,13 @@ function restoreLastCJKGlyphWidth(line: IDocumentSkeletonLine) {// Compression of punctuation marks at line start or line endfunction shrinkStartAndEndCJKPunctuation(line: IDocumentSkeletonLine) {for (const divide of line.divides) {+ const glyphGroupLength = divide.glyphGroup.length;+ if (glyphGroupLength < 2) {+ continue;+ }+const firstGlyph = divide.glyphGroup[0];- const lastGlyph = divide.glyphGroup[divide.glyphGroup.length - 1];+ const lastGlyph = divide.glyphGroup[glyphGroupLength - 1];if (isCjkRightAlignedPunctuation(firstGlyph.content)) {const shrinkAmount = firstGlyph.adjustability.shrinkability[0];