This shouldn't break the old hack. By caching the language pointer in _buildSpansForPara() (May be better exporting it right after getting pango context). For testing all shapings. Or it should rather try to detect the Telugu "te" language instead of "th" then allows the ligature sorting.
+ PangoLanguage* cache_pango_language_th = pango_language_from_string("th"); //Cache the pointer.
+
for(input_index = para->first_input_index ; input_index < _flow._input_stream.size() ; input_index++) {
if (_flow._input_stream[input_index]->Type() == CONTROL_CODE) { Layout::InputStreamControlCode const *control_code = static_cast<Layout::InputStreamControlCode const *>(_flow._input_stream[input_index]);
@@ -1248,6 +1250,7 @@ If ligatures other than with Mark, nonspacing are ever implemented in Pango this will screw up, for instance changing "fi" to "if". */
+ if(j - i){ std::sort(&(new_span.glyph_string->glyphs[i]), &(new_span.glyph_string->glyphs[j+1]), compareGlyphWidth); }
@@ -1263,6 +1266,7 @@ } else { // ltr sections are in order but glyphs in a log_cluster following a ligature may not be. Sort, but no block swapping. const unsigned nglyphs = new_span.glyph_string->num_glyphs;
+ const PangoLanguage* item_lang = para->pango_items[pango_item_index].item->analysis.language; unsigned i, j; for (i = 0 ; i < nglyphs ; i++)new_span.glyph_string->glyphs[i].attr.is_cluster_start = 0; for (i = 0 ; i < nglyphs ; i++) {
@@ -1271,7 +1275,8 @@ (new_span.glyph_string->log_clusters[j+1] == new_span.glyph_string->log_clusters[i]) )j++; /* see note in preceding section */
- if(j - i){
+
+ if( item_lang && item_lang != cache_pango_language_th && j - i){ std::sort(&(new_span.glyph_string->glyphs[i]), &(new_span.glyph_string->glyphs[j+1]), compareGlyphWidth); } new_span.glyph_string->glyphs[i].attr.is_cluster_start = 1;
This shouldn't break the old hack. By caching the language pointer in _buildSpansForP ara() (May be better exporting it right after getting pango context). For testing all shapings. Or it should rather try to detect the Telugu "te" language instead of "th" then allows the ligature sorting.
--- Layout- TNG-Compute. cpp.orig 2015-07-05 20:42:45.256153018 +0700 TNG-Compute. cpp 2015-07-05 22:10:38.469670749 +0700 >free_sequence( para->unbroken_ spans);
+++ Layout-
@@ -1099,6 +1099,8 @@
TRACE(("build spans\n"));
para-
+ PangoLanguage* cache_pango_ language_ th = pango_language_ from_string( "th"); //Cache the pointer. input_index = para->first_ input_index ; input_index < _flow._ input_stream. size() ; input_index++) { _input_ stream[ input_index] ->Type( ) == CONTROL_CODE) {
Layout: :InputStreamCon trolCode const *control_code = static_ cast<Layout: :InputStreamCon trolCode const *>(_flow. _input_ stream[ input_index] );
If ligatures other than with Mark, nonspacing are ever implemented in Pango this will screw up, for instance
changing "fi" to "if".
*/
if(j - i){
std: :sort(& (new_span. glyph_string- >glyphs[ i]), &(new_span. glyph_string- >glyphs[ j+1]), compareGlyphWidth);
}
}
else { // ltr sections are in order but glyphs in a log_cluster following a ligature may not be. Sort, but no block swapping.
const unsigned nglyphs = new_span. glyph_string- >num_glyphs; items[pango_ item_index] .item-> analysis. language;
unsigned i, j;
for (i = 0 ; i < nglyphs ; i++)new_ span.glyph_ string- >glyphs[ i].attr. is_cluster_ start = 0;
for (i = 0 ; i < nglyphs ; i++) {
(new_ span.glyph_ string- >log_clusters[ j+1] == new_span. glyph_string- >log_clusters[ i])
)j++;
/* see note in preceding section */ language_ th && j - i){
std: :sort(& (new_span. glyph_string- >glyphs[ i]), &(new_span. glyph_string- >glyphs[ j+1]), compareGlyphWidth);
}
new_span. glyph_string- >glyphs[ i].attr. is_cluster_ start = 1;
+
for(
if (_flow.
@@ -1248,6 +1250,7 @@
+
@@ -1263,6 +1266,7 @@
+ const PangoLanguage* item_lang = para->pango_
@@ -1271,7 +1275,8 @@
- if(j - i){
+
+ if( item_lang && item_lang != cache_pango_