vcl/source/gdi/CommonSalLayout.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
New commits: commit cd6b70497180dbf0f3f78684e74702c993bbe449 Author: Mark Hung <mark...@gmail.com> Date: Fri Mar 17 20:00:03 2017 +0800 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 <khaledho...@eglug.org> Tested-by: Jenkins <c...@libreoffice.org> 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) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits