summaryrefslogtreecommitdiff
path: root/sw/source/core/inc/scriptinfo.hxx
diff options
context:
space:
mode:
authorMark Hung <marklh9@gmail.com>2015-10-21 22:34:08 +0800
committerNorbert Thiebaud <nthiebaud@gmail.com>2015-11-03 20:01:46 +0000
commit281be263619a8e513a26e6a9165d1d77cf6524ea (patch)
tree93b961416e794b100fbc86ac5af80ec3a65428a2 /sw/source/core/inc/scriptinfo.hxx
parent2b48a5f1550e6f62931c2973086e8970f88f58ee (diff)
tdf#81144 Chinese full-width punctuation does not align properly
Ideographic fullstop and comma in most Chinese fonts are centered, while those in Japanese fonts align closer to the left. Original compression algorithm trimed right side of the punctuation, making fullwidth fullstop or comma in Chinese font visually unbalanced. In worst case, it crowds together with the followed compressed punctuation. This patch fix the situation in the folowing way 1) make compression less stronger. 2) Trim space according to glyph bearing to font height ratio. 3) fix a memory access violation issue Change-Id: Icff215064e6c442fd36eac8e01b01fb6acb27594 Reviewed-on: https://gerrit.libreoffice.org/19517 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com>
Diffstat (limited to 'sw/source/core/inc/scriptinfo.hxx')
-rw-r--r--sw/source/core/inc/scriptinfo.hxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/sw/source/core/inc/scriptinfo.hxx b/sw/source/core/inc/scriptinfo.hxx
index ee476ac983e4..2201343dc183 100644
--- a/sw/source/core/inc/scriptinfo.hxx
+++ b/sw/source/core/inc/scriptinfo.hxx
@@ -37,7 +37,7 @@ typedef std::list< sal_Int32 > PositionList;
class SwScriptInfo
{
public:
- enum CompType { KANA, SPECIAL_LEFT, SPECIAL_RIGHT, NONE };
+ enum CompType { KANA, SPECIAL_LEFT, SPECIAL_RIGHT, NONE, SPECIAL_MIDDLE};
private:
//! Records a single change in script type.
@@ -255,6 +255,7 @@ public:
// modifies the kerning array according to a given compress value
long Compress( long* pKernArray, sal_Int32 nIdx, sal_Int32 nLen,
const sal_uInt16 nCompress, const sal_uInt16 nFontHeight,
+ const bool bCentered,
Point* pPoint = NULL ) const;
/** Performs a kashida justification on the kerning array