summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorMark Hung <marklh9@gmail.com>2017-03-17 20:00:03 +0800
committerKhaled Hosny <khaledhosny@eglug.org>2017-03-17 22:47:53 +0000
commitcd6b70497180dbf0f3f78684e74702c993bbe449 (patch)
tree8577d4409ecf50d2390f6e4fe0e2067157d48904 /vcl
parent2cdca5d32e0b2d1efb9241e4e03e15b20f28363b (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>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/gdi/CommonSalLayout.cxx7
1 files changed, 5 insertions, 2 deletions
diff --git a/vcl/source/gdi/CommonSalLayout.cxx b/vcl/source/gdi/CommonSalLayout.cxx
index 06b815f56be6..7ef1fac1286f 100644
--- a/vcl/source/gdi/CommonSalLayout.cxx
+++ b/vcl/source/gdi/CommonSalLayout.cxx
@@ -305,7 +305,7 @@ namespace vcl {
#include "VerticalOrientationData.cxx"
- VerticalOrientation GetVerticalOrientation(sal_UCS4 cCh)
+ VerticalOrientation GetVerticalOrientation(sal_UCS4 cCh, const LanguageTag& rTag)
{
uint8_t nRet = 1;
@@ -313,6 +313,9 @@ namespace vcl {
{
nRet = sVerticalOrientationValues[sVerticalOrientationPages[0][cCh >> kVerticalOrientationCharBits]]
[cCh & ((1 << kVerticalOrientationCharBits) - 1)];
+ // Override fullwidth colon and semi-colon orientation. Tu is preferred.
+ if ((cCh == 0xff1a || cCh == 0xff1b) && rTag.getLanguage() == "zh")
+ nRet = 2;
}
else if (cCh < (kVerticalOrientationMaxPlane + 1) * 0x10000)
{
@@ -505,7 +508,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)