Package: gbdfed Version: 1.5-1.1 Tags: patch In the gbdfed main window, you can press ^Q to transpose the display of the font so that consecutive characters go down the columns rather than across the rows. After doing this, pressing the 'next' and 'previous' buttons in the glyph edit window (or, equivalently, hitting ^N and ^P in that window) cause the wrong glyphs to be highlighted in the main window.
For instance: load a BDF, and double-click the digit '5' to open it in a glyph edit window. Now press the 'next' button in the edit window. The window moves on to show the '6' glyph, and the highlight in the main window moves on to '6' as well. But if you do the same experiment again and this time press ^Q in the main window before double-clicking '5', then the highlight in the main window will move _right_ from the '5' to the 'E' in the next column, while the glyph edit window still shows '6' as you expected. The problem seems to be due to deliberate action in the fontgrid_select_next_glyph and fontgrid_select_previous_glyph functions, perhaps because there was some original intention to have ^N and ^P move along rows even when the font was displayed in columns. I attach a patch which fixes the problem for me by removing the apparently deliberate but wrong code, so that in both modes, the highlight in the main font grid window matches the glyph actually selected in the editing window. Cheers, Simon -- for k in [pow(x,37,0x13AC59F3ECAC3127065A9) for x in [0x195A0BCE1C2F0310B43C, 0x73A0CE584254AB23D5A0, 0x12878657EA814421CC92, 0x7373445BB3DA69996F4A, 0x77A7ED5BC3AA700E80B2, 0xE9C71C94ED87ADCF7367, 0xFE920395F414C1A5DB50]]: print "".join([chr(32+3*((k>>x)&1))for x in range(79)]) # <ana...@pobox.com>
diff --git a/fontgrid.c b/fontgrid.c index b3222d5..5d9acd9 100644 --- a/fontgrid.c +++ b/fontgrid.c @@ -4711,10 +4711,7 @@ fontgrid_select_next_glyph(Fontgrid *fw, gint32 code) return FALSE; } - if (fw->orientation == GTK_ORIENTATION_VERTICAL) - code += (fw->cell_rows * count); - else - code += count; + code += count; if (fw->unencoded && code > gp->encoding) code = gp->encoding; @@ -4794,10 +4791,7 @@ fontgrid_select_previous_glyph(Fontgrid *fw, gint32 code) return FALSE; } - if (fw->orientation == GTK_ORIENTATION_VERTICAL) - code -= (fw->cell_rows * count); - else - code -= count; + code -= count; if (code < 0) code = 0;