aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndrew Innes1998-11-03 22:21:58 +0000
committerAndrew Innes1998-11-03 22:21:58 +0000
commit1a292d24f1481eab918d6a46e22d1f75ed9322ee (patch)
tree3c3cb20a930988496401cc67033e13c6fee50be1 /src
parentce8c28097dbde372bc2ab9f082ba160a7ffa42ad (diff)
downloademacs-1a292d24f1481eab918d6a46e22d1f75ed9322ee.tar.gz
emacs-1a292d24f1481eab918d6a46e22d1f75ed9322ee.zip
(x_to_w32_font): Specify DEFAULT_CHARSET in the w32 LOGFONT struct if
x font doesn't specify the charset. (x_to_w32_charset): Change >= to == when testing results of stricmp.
Diffstat (limited to 'src')
-rw-r--r--src/w32fns.c59
1 files changed, 32 insertions, 27 deletions
diff --git a/src/w32fns.c b/src/w32fns.c
index 5b65821dbda..d269214b9ae 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -4502,29 +4502,29 @@ int size;
4502 4502
4503 font->hfont = CreateFontIndirect (&lf); 4503 font->hfont = CreateFontIndirect (&lf);
4504 4504
4505 if (font->hfont == NULL) 4505 if (font->hfont == NULL)
4506 { 4506 {
4507 ok = FALSE; 4507 ok = FALSE;
4508 } 4508 }
4509 else 4509 else
4510 { 4510 {
4511 HDC hdc; 4511 HDC hdc;
4512 HANDLE oldobj; 4512 HANDLE oldobj;
4513 4513
4514 hdc = GetDC (dpyinfo->root_window); 4514 hdc = GetDC (dpyinfo->root_window);
4515 oldobj = SelectObject (hdc, font->hfont); 4515 oldobj = SelectObject (hdc, font->hfont);
4516 ok = GetTextMetrics (hdc, &font->tm); 4516 ok = GetTextMetrics (hdc, &font->tm);
4517 SelectObject (hdc, oldobj); 4517 SelectObject (hdc, oldobj);
4518 ReleaseDC (dpyinfo->root_window, hdc); 4518 ReleaseDC (dpyinfo->root_window, hdc);
4519 } 4519 }
4520 4520
4521 UNBLOCK_INPUT; 4521 UNBLOCK_INPUT;
4522 4522
4523 if (!ok) 4523 if (!ok)
4524 { 4524 {
4525 w32_unload_font (dpyinfo, font); 4525 w32_unload_font (dpyinfo, font);
4526 return (NULL); 4526 return (NULL);
4527} 4527 }
4528 4528
4529 /* Do we need to create the table? */ 4529 /* Do we need to create the table? */
4530 if (dpyinfo->font_table_size == 0) 4530 if (dpyinfo->font_table_size == 0)
@@ -4722,14 +4722,14 @@ x_to_w32_charset (lpcs)
4722{ 4722{
4723 if (!lpcs) return (0); 4723 if (!lpcs) return (0);
4724 4724
4725 if (stricmp (lpcs,"ansi") == 0) return ANSI_CHARSET; 4725 if (stricmp (lpcs,"ansi") == 0) return ANSI_CHARSET;
4726 else if (stricmp (lpcs,"iso8859-1") == 0) return ANSI_CHARSET; 4726 else if (stricmp (lpcs,"iso8859-1") == 0) return ANSI_CHARSET;
4727 else if (stricmp (lpcs, "symbol") >= 0) return SYMBOL_CHARSET; 4727 else if (stricmp (lpcs, "symbol") == 0) return SYMBOL_CHARSET;
4728 else if (stricmp (lpcs, "jis") >= 0) return SHIFTJIS_CHARSET; 4728 else if (stricmp (lpcs, "jis") == 0) return SHIFTJIS_CHARSET;
4729 else if (stricmp (lpcs, "ksc5601") == 0) return HANGEUL_CHARSET; 4729 else if (stricmp (lpcs, "ksc5601") == 0) return HANGEUL_CHARSET;
4730 else if (stricmp (lpcs, "gb2312") == 0) return GB2312_CHARSET; 4730 else if (stricmp (lpcs, "gb2312") == 0) return GB2312_CHARSET;
4731 else if (stricmp (lpcs, "big5") == 0) return CHINESEBIG5_CHARSET; 4731 else if (stricmp (lpcs, "big5") == 0) return CHINESEBIG5_CHARSET;
4732 else if (stricmp (lpcs, "oem") >= 0) return OEM_CHARSET; 4732 else if (stricmp (lpcs, "oem") == 0) return OEM_CHARSET;
4733 4733
4734#ifdef EASTEUROPE_CHARSET 4734#ifdef EASTEUROPE_CHARSET
4735 else if (stricmp (lpcs, "iso8859-2") == 0) return EASTEUROPE_CHARSET; 4735 else if (stricmp (lpcs, "iso8859-2") == 0) return EASTEUROPE_CHARSET;
@@ -4747,10 +4747,10 @@ x_to_w32_charset (lpcs)
4747#endif 4747#endif
4748 4748
4749#ifdef UNICODE_CHARSET 4749#ifdef UNICODE_CHARSET
4750 else if (stricmp (lpcs,"iso10646") == 0) return UNICODE_CHARSET; 4750 else if (stricmp (lpcs,"iso10646") == 0) return UNICODE_CHARSET;
4751 else if (stricmp (lpcs, "unicode") >= 0) return UNICODE_CHARSET; 4751 else if (stricmp (lpcs, "unicode") == 0) return UNICODE_CHARSET;
4752#endif 4752#endif
4753 else if (lpcs[0] == '#') return atoi (lpcs + 1); 4753 else if (lpcs[0] == '#') return atoi (lpcs + 1);
4754 else 4754 else
4755 return DEFAULT_CHARSET; 4755 return DEFAULT_CHARSET;
4756} 4756}
@@ -4872,6 +4872,7 @@ x_to_w32_font (lpxstr, lplogfont)
4872 4872
4873 memset (lplogfont, 0, sizeof (*lplogfont)); 4873 memset (lplogfont, 0, sizeof (*lplogfont));
4874 4874
4875 /* Set default value for each field. */
4875#if 1 4876#if 1
4876 lplogfont->lfOutPrecision = OUT_DEFAULT_PRECIS; 4877 lplogfont->lfOutPrecision = OUT_DEFAULT_PRECIS;
4877 lplogfont->lfClipPrecision = CLIP_DEFAULT_PRECIS; 4878 lplogfont->lfClipPrecision = CLIP_DEFAULT_PRECIS;
@@ -4883,6 +4884,10 @@ x_to_w32_font (lpxstr, lplogfont)
4883 lplogfont->lfQuality = PROOF_QUALITY; 4884 lplogfont->lfQuality = PROOF_QUALITY;
4884#endif 4885#endif
4885 4886
4887 lplogfont->lfCharSet = DEFAULT_CHARSET;
4888 lplogfont->lfWeight = FW_DONTCARE;
4889 lplogfont->lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
4890
4886 if (!lpxstr) 4891 if (!lpxstr)
4887 return FALSE; 4892 return FALSE;
4888 4893