summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Hung <marklh9@gmail.com>2017-03-17 20:00:03 +0800
committerKhaled Hosny <khaledhosny@eglug.org>2017-03-19 07:20:08 +0000
commit465da7d95e17367e615ec5ef65f368d89c8d7f5d (patch)
tree420780641ebe98436a331a52d453fb6e8adbf71c
parent49eadd40b5f0de6fa97498d89f20118b996385d2 (diff)
tdf#106295 fix vertical orientation for fullwidth colon and semicolon.
Chinese users would expect fullwidth colon (U+FF1A) and semi-colon (U+FF1B) to be Tu( transformed upright ) instead of Tr ( Transformed rotated ) in vertical writing mode. Make them exceptions of UTR50 when language is zh. Change-Id: If7d01199973d73136a621bf2f32377da76ccb22a Reviewed-on: https://gerrit.libreoffice.org/34980 Reviewed-by: Khaled Hosny <khaledhosny@eglug.org> Tested-by: Jenkins <ci@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/35382
-rw-r--r--vcl/source/gdi/CommonSalLayout.cxx8
1 files changed, 6 insertions, 2 deletions
diff --git a/vcl/source/gdi/CommonSalLayout.cxx b/vcl/source/gdi/CommonSalLayout.cxx
index df2849828df7..4d8d65f9501c 100644
--- a/vcl/source/gdi/CommonSalLayout.cxx
+++ b/vcl/source/gdi/CommonSalLayout.cxx
@@ -330,8 +330,12 @@ namespace vcl {
#include "VerticalOrientationData.cxx"
- VerticalOrientation GetVerticalOrientation(sal_UCS4 cCh)
+ VerticalOrientation GetVerticalOrientation(sal_UCS4 cCh, const LanguageTag& rTag)
{
+ // Override fullwidth colon and semi-colon orientation. Tu is preferred.
+ if ((cCh == 0xff1a || cCh == 0xff1b) && rTag.getLanguage() == "zh")
+ return VerticalOrientation::TransformedUpright;
+
uint8_t nRet = 1;
if (cCh < 0x10000)
@@ -524,7 +528,7 @@ bool CommonSalLayout::LayoutText(ImplLayoutArgs& rArgs)
{
sal_Int32 nPrevIdx = nIdx;
sal_UCS4 aChar = rArgs.mrStr.iterateCodePoints(&nIdx);
- VerticalOrientation aVo = vcl::GetVerticalOrientation(aChar);
+ VerticalOrientation aVo = vcl::GetVerticalOrientation(aChar, rArgs.maLanguageTag);
sal_UCS4 aVariationSelector = 0;
if (nIdx < nEndRunPos)