r19990 by jghali - #12997: Kerning between non-CJK and CJK letters does not appear until the text frame containing them is modified

scribus-commit scribus-commit at lists.scribus.net
Sat Apr 11 14:15:13 UTC 2015


Author: jghali
Date: Sat Apr 11 14:15:13 2015
New Revision: 19990

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=19990
Log:
#12997: Kerning between non-CJK and CJK letters does not appear until the text frame containing them is modified

Modified:
    trunk/Scribus/scribus/pageitem_textframe.cpp

Modified: trunk/Scribus/scribus/pageitem_textframe.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19990&path=/trunk/Scribus/scribus/pageitem_textframe.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem_textframe.cpp (original)
+++ trunk/Scribus/scribus/pageitem_textframe.cpp Sat Apr 11 14:15:13 2015
@@ -1817,7 +1817,7 @@
 							case SpecialChars::CJK_KANJI:
 							case SpecialChars::CJK_KANA:
 							case SpecialChars::CJK_NOTOP:
-								kern = wide / 4;
+								kern = charStyle.fontSize() / 10 / 4;
 								wide += kern;
 								glyphs->last()->xadvance += kern;
 							}
@@ -1830,7 +1830,7 @@
 								case SpecialChars::CJK_COMMA:
 								case SpecialChars::CJK_PERIOD:
 								case SpecialChars::CJK_MIDPOINT:
-									kern = -wide / 2;
+									kern = -charStyle.fontSize() / 10 / 2;
 									wide += kern;
 									glyphs->last()->xadvance += kern;
 								}
@@ -1840,7 +1840,7 @@
 								switch(nextStat & SpecialChars::CJK_CHAR_MASK){
 								case SpecialChars::CJK_FENCE_BEGIN:
 								case SpecialChars::CJK_FENCE_END:
-									kern = -wide / 2;
+									kern = -charStyle.fontSize() / 10 / 2;
 									wide += kern;
 									glyphs->last()->xadvance += kern;
 								}
@@ -1848,7 +1848,7 @@
 							case SpecialChars::CJK_MIDPOINT:
 								switch(nextStat & SpecialChars::CJK_CHAR_MASK){
 								case SpecialChars::CJK_FENCE_BEGIN:
-									kern = -wide / 2;
+									kern = -charStyle.fontSize() / 10 / 2;
 									wide += kern;
 									glyphs->last()->xadvance += kern;
 								}
@@ -1860,7 +1860,7 @@
 									prevStat = SpecialChars::getCJKAttr(itemText.text(a-1)) & SpecialChars::CJK_CHAR_MASK;
 								}
 								if (prevStat == SpecialChars::CJK_FENCE_BEGIN){
-									kern = -wide / 2;
+									kern = -charStyle.fontSize() / 10 / 2;
 									wide += kern;
 									glyphs->last()->xadvance += kern;
 									glyphs->last()->xoffset += kern;
@@ -1875,7 +1875,8 @@
 							case SpecialChars::CJK_KANJI:
 							case SpecialChars::CJK_KANA:
 							case SpecialChars::CJK_NOTOP:
-								kern = itemText.getGlyphs(a+1)->wide() / 4;
+								// use the size of the current char instead of the next one
+								kern = charStyle.fontSize() / 10 / 4;
 								wide += kern;
 								glyphs->last()->xadvance += kern;
 							}




More information about the scribus-commit mailing list