diff options
author | Mark Hung <marklh9@gmail.com> | 2016-10-08 22:08:28 +0800 |
---|---|---|
committer | jan iversen <jani@documentfoundation.org> | 2016-11-17 07:08:17 +0000 |
commit | 53778372a269da7c51958a7e234df4d41027fb77 (patch) | |
tree | 3cc3abd816c60f6676519c68c74fa14d03042d57 /vcl/win/gdi | |
parent | f20422ce9edfd5d49df97b80a9e615d59d0fcba2 (diff) |
tdf#43740 SimpleWinLayout::LayoutText only advance position for actual glyphs.
Unicode variance selectors selects glyph of previous base character and
do not have character width itself.
Change-Id: Id0a0d9fcd40794b6db8ff89f84ad42a842472916
Reviewed-on: https://gerrit.libreoffice.org/29618
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: jan iversen <jani@documentfoundation.org>
Diffstat (limited to 'vcl/win/gdi')
-rw-r--r-- | vcl/win/gdi/winlayout.cxx | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/vcl/win/gdi/winlayout.cxx b/vcl/win/gdi/winlayout.cxx index 671fa3fd0d08..e5b891dd5994 100644 --- a/vcl/win/gdi/winlayout.cxx +++ b/vcl/win/gdi/winlayout.cxx @@ -411,8 +411,25 @@ bool SimpleWinLayout::LayoutText( ImplLayoutArgs& rArgs ) } } - // get the advance width for the current UTF-32 code point - int nGlyphWidth = mrWinFontEntry.GetCachedGlyphWidth( nCharCode ); + int nGlyphWidth = 0; + // Unicode variance selectors selects glyph of previous base character, do not have width itself. + if ( nCharCode >= 0xFE00 && nCharCode <= 0xFE0F || nCharCode >= 0xE0100 && nCharCode <= 0xE01EF ) + { + mpOutGlyphs[ i ] = DROPPED_OUTGLYPH; + mpGlyphAdvances[ i ] = 0; + if ( bSurrogate && ( i+1 ) < mnGlyphCount ) + { + mpOutGlyphs[ ++i ] = DROPPED_OUTGLYPH; + mpGlyphAdvances[ i ] = 0; + } + continue; + } + else + { + // get the advance width for the current UTF-32 code point + nGlyphWidth = mrWinFontEntry.GetCachedGlyphWidth( nCharCode ); + } + if( nGlyphWidth == -1 ) { ABC aABC; |