aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Rumney2008-06-01 21:57:06 +0000
committerJason Rumney2008-06-01 21:57:06 +0000
commitaee986fd8bf8e748b767fb3d8e6e4bdb31559724 (patch)
treef7dbcb132f26c9d0fb71cd093f17a579b8df5df8 /src
parent7bf0295ecc6c4deb0265597701d0acb5e4a71e15 (diff)
downloademacs-aee986fd8bf8e748b767fb3d8e6e4bdb31559724.tar.gz
emacs-aee986fd8bf8e748b767fb3d8e6e4bdb31559724.zip
(w32_enumfont_pattern_entity): Use requested registry.
Treat iso10646-1 and Windows DEFAULT_CHARSET specially. Duplicate iso8859-1 fonts as iso10646-1 if no registry specified. Don't add empty script list. (w32_registry): Only map DEFAULT_CHARSET to iso10646-1 here.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog10
-rw-r--r--src/w32font.c60
2 files changed, 57 insertions, 13 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index c9ca9a966aa..eabc0e38a2c 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,6 +1,14 @@
12008-06-01 Jason Rumney <jasonr@gnu.org>
2
3 * w32font.c (w32_enumfont_pattern_entity): Use requested registry.
4 Treat iso10646-1 and Windows DEFAULT_CHARSET specially.
5 Duplicate iso8859-1 fonts as iso10646-1 if no registry specified.
6 Don't add empty script list.
7 (w32_registry): Only map DEFAULT_CHARSET to iso10646-1 here.
8
12008-06-01 Dan Nicolaescu <dann@ics.uci.edu> 92008-06-01 Dan Nicolaescu <dann@ics.uci.edu>
2 10
3 * Makefile.in (dot, dotdot): Remove, update users. 11 * Makefile.in (dot, dotdot): Remove, update users.
4 ".." has been used elsewhere in the file for a long time. 12 ".." has been used elsewhere in the file for a long time.
5 (LIBXT_STATIC): Remove conditional based on unused variable. 13 (LIBXT_STATIC): Remove conditional based on unused variable.
6 14
diff --git a/src/w32font.c b/src/w32font.c
index 7509a795432..233efdab741 100644
--- a/src/w32font.c
+++ b/src/w32font.c
@@ -1022,8 +1022,9 @@ w32_enumfont_pattern_entity (frame, logical_font, physical_font,
1022 of getting this information easily. */ 1022 of getting this information easily. */
1023 if (font_type & TRUETYPE_FONTTYPE) 1023 if (font_type & TRUETYPE_FONTTYPE)
1024 { 1024 {
1025 font_put_extra (entity, QCscript, 1025 tem = font_supported_scripts (&physical_font->ntmFontSig);
1026 font_supported_scripts (&physical_font->ntmFontSig)); 1026 if (!NILP (tem))
1027 font_put_extra (entity, QCscript, tem);
1027 } 1028 }
1028 1029
1029 /* This information is not fully available when opening fonts, so 1030 /* This information is not fully available when opening fonts, so
@@ -1352,7 +1353,44 @@ add_font_entity_to_list (logical_font, physical_font, font_type, lParam)
1352 &match_data->pattern, 1353 &match_data->pattern,
1353 backend); 1354 backend);
1354 if (!NILP (entity)) 1355 if (!NILP (entity))
1355 match_data->list = Fcons (entity, match_data->list); 1356 {
1357 Lisp_Object spec_charset = AREF (match_data->orig_font_spec,
1358 FONT_REGISTRY_INDEX);
1359
1360 /* If registry was specified as iso10646-1, only report
1361 ANSI and DEFAULT charsets, as most unicode fonts will
1362 contain one of those plus others. */
1363 if (EQ (spec_charset, Qiso10646_1)
1364 && logical_font->elfLogFont.lfCharSet != DEFAULT_CHARSET
1365 && logical_font->elfLogFont.lfCharSet != ANSI_CHARSET)
1366 return 1;
1367 /* If registry was specified, but did not map to a windows
1368 charset, only report fonts that have unknown charsets.
1369 This will still report fonts that don't match, but at
1370 least it eliminates known definite mismatches. */
1371 else if (!NILP (spec_charset)
1372 && !EQ (spec_charset, Qiso10646_1)
1373 && match_data->pattern.lfCharSet == DEFAULT_CHARSET
1374 && logical_font->elfLogFont.lfCharSet != DEFAULT_CHARSET)
1375 return 1;
1376
1377 /* If registry was specified, ensure it is reported as the same. */
1378 if (!NILP (spec_charset))
1379 ASET (entity, FONT_REGISTRY_INDEX, spec_charset);
1380
1381 match_data->list = Fcons (entity, match_data->list);
1382
1383 /* If no registry specified, duplicate iso8859-1 truetype fonts
1384 as iso10646-1. */
1385 if (NILP (spec_charset)
1386 && font_type == TRUETYPE_FONTTYPE
1387 && logical_font->elfLogFont.lfCharSet == ANSI_CHARSET)
1388 {
1389 Lisp_Object tem = Fcopy_font_spec (entity);
1390 ASET (tem, FONT_REGISTRY_INDEX, Qiso10646_1);
1391 match_data->list = Fcons (tem, match_data->list);
1392 }
1393 }
1356 } 1394 }
1357 return 1; 1395 return 1;
1358} 1396}
@@ -1395,17 +1433,15 @@ w32_registry (w32_charset, font_type)
1395 LONG w32_charset; 1433 LONG w32_charset;
1396 DWORD font_type; 1434 DWORD font_type;
1397{ 1435{
1398 /* If charset is defaulted, use ANSI (unicode for truetype fonts). */ 1436 char *charset;
1437
1438 /* If charset is defaulted, charset is unicode or unknown, depending on
1439 font type. */
1399 if (w32_charset == DEFAULT_CHARSET) 1440 if (w32_charset == DEFAULT_CHARSET)
1400 w32_charset = ANSI_CHARSET; 1441 return font_type == TRUETYPE_FONTTYPE ? Qiso10646_1 : Qunknown;
1401 1442
1402 if (font_type == TRUETYPE_FONTTYPE && w32_charset == ANSI_CHARSET) 1443 charset = w32_to_x_charset (w32_charset, NULL);
1403 return Qiso10646_1; 1444 return font_intern_prop (charset, strlen(charset));
1404 else
1405 {
1406 char * charset = w32_to_x_charset (w32_charset, NULL);
1407 return font_intern_prop (charset, strlen(charset));
1408 }
1409} 1445}
1410 1446
1411static int 1447static int