CannaIM: can't display conversion candidate in KouhoWindow (#8300).

* To display conversion candidate in KouhoWindow, we need to change skipping
  index bytes. In CannaInterface::GenerateKouhoString(), we have skipped
  2 bytes as index before conversion candidate, but index is UTF8 FULL
  WIDTH NUMBERS, so we need to skip 3 bytes.
* To show highlightRect correctly, change Invalidate(highlightRect) to
  Invalidate() in KouhoView::HighlightLine().
* Change BeOS's Haru font to VL PGothic (CannaLooper::ReadSettings()
  and KouhoWindow::KouhoWindow()).
This commit is contained in:
Murai Takashi
2012-02-18 15:06:57 +01:00
committed by Jérôme Duval
parent 4ea3e0d3b8
commit d8116125d1
3 changed files with 9 additions and 10 deletions
@@ -593,14 +593,14 @@ SERIAL_PRINT(( "CannaInterface: GenerateKouhoStr() revPos = %d, revLen = %d, mod
&& kouhoRevLine != -1) && kouhoRevLine != -1)
|| current_mode == CANNA_MODE_TourokuDicMode || current_mode == CANNA_MODE_TourokuDicMode
|| current_mode == CANNA_MODE_BushuMode) { || current_mode == CANNA_MODE_BushuMode) {
// remove first index // remove first index (3 bytes)
memmove(kouhoUTF, kouhoUTF + 2, kouhoUTFLen - 1); memmove(kouhoUTF, kouhoUTF + 3, kouhoUTFLen - 2);
// convert full-space to LF // convert full width space and following 3 bytes index to LF
while ((index = strstr(kouhoUTF, "\xe3\x80\x80")) != NULL) { while ((index = strstr(kouhoUTF, "\xe3\x80\x80")) != NULL) {
*index = '\x0a'; *index = '\x0a';
len = strlen(index); len = strlen(index);
memmove(index + 1, index + 5, len - 4); memmove(index + 1, index + 6, len - 5);
} }
kouhoUTFLen = strlen(kouhoUTF); kouhoUTFLen = strlen(kouhoUTF);
} }
@@ -109,8 +109,8 @@ CannaLooper::ReadSettings(char* basePath)
font_family family; font_family family;
font_style style; font_style style;
strcpy(family, "Haru"); strcpy(family, "VL PGothic");
strcpy(style, "Regular"); strcpy(style, "regular");
fKouhoFont.SetFamilyAndStyle(family, style); fKouhoFont.SetFamilyAndStyle(family, style);
fKouhoFont.SetSize(12); fKouhoFont.SetSize(12);
@@ -33,8 +33,8 @@ KouhoWindow::KouhoWindow( BFont *font, BLooper *looper )
font_family family; font_family family;
font_style style; font_style style;
strcpy( family, "Haru" ); strcpy( family, "VL PGothic" );
strcpy( style, "Regular" ); strcpy( style, "regular" );
indexfont.SetFamilyAndStyle( family, style ); indexfont.SetFamilyAndStyle( family, style );
indexfont.SetSize( 10 ); indexfont.SetSize( 10 );
@@ -271,8 +271,7 @@ void KouhoView::HighlightLine( int32 line )
highlightRect = region.RectAt( 0 ); highlightRect = region.RectAt( 0 );
//extend highlihght region to right end //extend highlihght region to right end
highlightRect.right = Bounds().right; highlightRect.right = Bounds().right;
Invalidate( highlightRect ); Invalidate();
} }
} }