aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornyamatongwe <unknown>2001-06-14 02:08:03 +0000
committernyamatongwe <unknown>2001-06-14 02:08:03 +0000
commitcc240f993c2b50936c1b8f634ed60d26a48ab66b (patch)
tree4be4d02a3577d2efd7d1b76a444007591738364d
parente61ba193e48d583f7509645dc5c09eecacf4156d (diff)
downloadscintilla-mirror-cc240f993c2b50936c1b8f634ed60d26a48ab66b.tar.gz
Changes to make Hungarian characters appear and to improve
font selection for non Western European languages.
-rw-r--r--gtk/PlatGTK.cxx41
-rw-r--r--gtk/ScintillaGTK.cxx6
2 files changed, 25 insertions, 22 deletions
diff --git a/gtk/PlatGTK.cxx b/gtk/PlatGTK.cxx
index 18bf4fe4e..7e4aa554a 100644
--- a/gtk/PlatGTK.cxx
+++ b/gtk/PlatGTK.cxx
@@ -151,45 +151,45 @@ Font::~Font() {}
static const char *CharacterSetName(int characterSet) {
switch (characterSet) {
case SC_CHARSET_ANSI:
- return "iso8859";
+ return "iso8859-*";
case SC_CHARSET_DEFAULT:
- return "iso8859";
+ return "iso8859-*";
case SC_CHARSET_BALTIC:
- return "*";
+ return "*-*";
case SC_CHARSET_CHINESEBIG5:
- return "*";
+ return "*-*";
case SC_CHARSET_EASTEUROPE:
- return "iso8859-2";
+ return "*-2";
case SC_CHARSET_GB2312:
- return "gb2312.1980";
+ return "gb2312.1980-*";
case SC_CHARSET_GREEK:
- return "adobe";
+ return "*-7";
case SC_CHARSET_HANGUL:
- return "ksc5601.1987";
+ return "ksc5601.1987-*";
case SC_CHARSET_MAC:
- return "*";
+ return "*-*";
case SC_CHARSET_OEM:
- return "*";
+ return "*-*";
case SC_CHARSET_RUSSIAN:
- return "*";
+ return "*-r";
case SC_CHARSET_SHIFTJIS:
- return "jisx0208.1983";
+ return "jisx0208.1983-*";
case SC_CHARSET_SYMBOL:
- return "*";
+ return "*-*";
case SC_CHARSET_TURKISH:
- return "*";
+ return "*-*";
case SC_CHARSET_JOHAB:
- return "*";
+ return "*-*";
case SC_CHARSET_HEBREW:
- return "*";
+ return "*-8";
case SC_CHARSET_ARABIC:
- return "*";
+ return "*-6";
case SC_CHARSET_VIETNAMESE:
- return "*";
+ return "*-*";
case SC_CHARSET_THAI:
- return "*";
+ return "*-*";
default:
- return "*";
+ return "*-*";
}
}
@@ -221,7 +221,6 @@ void Font::Create(const char *faceName, int characterSet,
strcat(fontspec, sizePts);
strcat(fontspec, "-*-*-*-*-");
strcat(fontspec, CharacterSetName(characterSet));
- strcat(fontspec, "-*");
id = gdk_font_load(fontspec);
if (!id) {
// Font not available so substitute a reasonable code font
diff --git a/gtk/ScintillaGTK.cxx b/gtk/ScintillaGTK.cxx
index 528b6af99..6619775e1 100644
--- a/gtk/ScintillaGTK.cxx
+++ b/gtk/ScintillaGTK.cxx
@@ -1303,7 +1303,8 @@ static int KeyTranslate(int keyIn) {
gint ScintillaGTK::KeyPress(GtkWidget *widget, GdkEventKey *event) {
ScintillaGTK *sciThis = ScintillaFromWidget(widget);
- //Platform::DebugPrintf("SC-key: %d %x\n",event->keyval, event->state);
+ //Platform::DebugPrintf("SC-key: %d %x [%s]\n",
+ // event->keyval, event->state, (event->length > 0) ? event->string : "empty");
bool shift = event->state & GDK_SHIFT_MASK;
bool ctrl = event->state & GDK_CONTROL_MASK;
bool alt = event->state & GDK_MOD1_MASK;
@@ -1314,6 +1315,9 @@ gint ScintillaGTK::KeyPress(GtkWidget *widget, GdkEventKey *event) {
key &= 0x7F;
else
key = KeyTranslate(key);
+ // Hack for keys between 256 and 511 but makes Hungarian work.
+ if ((key >= GDK_Aogonek) && (key <= GDK_abovedot))
+ key &= 0xff;
bool consumed = false;
int added = sciThis->KeyDown(key, shift, ctrl, alt, &consumed);