diff options
| author | Kenichi Handa | 2008-05-14 00:39:27 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2008-05-14 00:39:27 +0000 |
| commit | fd302b0276e69e870199a3035871286251939cb0 (patch) | |
| tree | 6f03e84c1c63e6b3a3b3959e16bb5b19843c9c3a /src | |
| parent | 28ca067bdcdda011838aac56eeb9bfaf716a843a (diff) | |
| download | emacs-fd302b0276e69e870199a3035871286251939cb0.tar.gz emacs-fd302b0276e69e870199a3035871286251939cb0.zip | |
Delete USE_FONT_BACKEND conditional.
(uniscribe_open): Return value changed to font-object. Adjusted
for the format change of font-object.
(uniscribe_otf_capability): Adjusted for the change of struct
font.
(add_opentype_font_name_to_list): Don't downcase names.
(uniscribe_font_driver): Adjusted for the change of struct
font_driver.
Diffstat (limited to 'src')
| -rw-r--r-- | src/w32uniscribe.c | 36 |
1 files changed, 14 insertions, 22 deletions
diff --git a/src/w32uniscribe.c b/src/w32uniscribe.c index 6682def4f1a..2348bdaf2eb 100644 --- a/src/w32uniscribe.c +++ b/src/w32uniscribe.c | |||
| @@ -18,7 +18,6 @@ along with GNU Emacs; see the file COPYING. If not, write to | |||
| 18 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 18 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 19 | Boston, MA 02110-1301, USA. */ | 19 | Boston, MA 02110-1301, USA. */ |
| 20 | 20 | ||
| 21 | #ifdef USE_FONT_BACKEND | ||
| 22 | 21 | ||
| 23 | #include <config.h> | 22 | #include <config.h> |
| 24 | /* Override API version - Uniscribe is only available as standard since | 23 | /* Override API version - Uniscribe is only available as standard since |
| @@ -112,32 +111,29 @@ uniscribe_list_family (frame) | |||
| 112 | return list; | 111 | return list; |
| 113 | } | 112 | } |
| 114 | 113 | ||
| 115 | static struct font * | 114 | static Lisp_Object |
| 116 | uniscribe_open (f, font_entity, pixel_size) | 115 | uniscribe_open (f, font_entity, pixel_size) |
| 117 | FRAME_PTR f; | 116 | FRAME_PTR f; |
| 118 | Lisp_Object font_entity; | 117 | Lisp_Object font_entity; |
| 119 | int pixel_size; | 118 | int pixel_size; |
| 120 | { | 119 | { |
| 120 | Lisp_Object font_object | ||
| 121 | = font_make_object (VECSIZE (struct uniscribe_font_info)); | ||
| 121 | struct uniscribe_font_info *uniscribe_font | 122 | struct uniscribe_font_info *uniscribe_font |
| 122 | = xmalloc (sizeof (struct uniscribe_font_info)); | 123 | = (struct uniscribe_font_info *) XFONT_OBJECT (font_object); |
| 123 | |||
| 124 | if (uniscribe_font == NULL) | ||
| 125 | return NULL; | ||
| 126 | 124 | ||
| 127 | if (!w32font_open_internal (f, font_entity, pixel_size, | 125 | if (!w32font_open_internal (f, font_entity, pixel_size, font_object)) |
| 128 | (struct w32font_info *) uniscribe_font)) | ||
| 129 | { | 126 | { |
| 130 | xfree (uniscribe_font); | 127 | return Qnil; |
| 131 | return NULL; | ||
| 132 | } | 128 | } |
| 133 | 129 | ||
| 134 | /* Initialize the cache for this font. */ | 130 | /* Initialize the cache for this font. */ |
| 135 | uniscribe_font->cache = NULL; | 131 | uniscribe_font->cache = NULL; |
| 136 | /* Mark the format as opentype */ | 132 | /* Mark the format as opentype */ |
| 137 | uniscribe_font->w32_font.font.format = Qopentype; | 133 | uniscribe_font->w32_font.font.props[FONT_FORMAT_INDEX] = Qopentype; |
| 138 | uniscribe_font->w32_font.font.driver = &uniscribe_font_driver; | 134 | uniscribe_font->w32_font.font.driver = &uniscribe_font_driver; |
| 139 | 135 | ||
| 140 | return (struct font *) uniscribe_font; | 136 | return font_object; |
| 141 | } | 137 | } |
| 142 | 138 | ||
| 143 | static void | 139 | static void |
| @@ -168,8 +164,7 @@ uniscribe_otf_capability (font) | |||
| 168 | 164 | ||
| 169 | f = XFRAME (selected_frame); | 165 | f = XFRAME (selected_frame); |
| 170 | context = get_frame_dc (f); | 166 | context = get_frame_dc (f); |
| 171 | old_font = SelectObject (context, | 167 | old_font = SelectObject (context, FONT_COMPAT (font)->hfont); |
| 172 | ((W32FontStruct *) (font->font.font))->hfont); | ||
| 173 | 168 | ||
| 174 | features = otf_features (context, "GSUB"); | 169 | features = otf_features (context, "GSUB"); |
| 175 | XSETCAR (capability, features); | 170 | XSETCAR (capability, features); |
| @@ -262,8 +257,7 @@ uniscribe_shape (lgstring) | |||
| 262 | 257 | ||
| 263 | f = XFRAME (selected_frame); | 258 | f = XFRAME (selected_frame); |
| 264 | context = get_frame_dc (f); | 259 | context = get_frame_dc (f); |
| 265 | old_font = SelectObject (context, | 260 | old_font = SelectObject (context, FONT_COMPAT (font)->hfont); |
| 266 | ((W32FontStruct *) (font->font.font))->hfont); | ||
| 267 | 261 | ||
| 268 | glyphs = alloca (max_glyphs * sizeof (WORD)); | 262 | glyphs = alloca (max_glyphs * sizeof (WORD)); |
| 269 | clusters = alloca (nchars * sizeof (WORD)); | 263 | clusters = alloca (nchars * sizeof (WORD)); |
| @@ -428,8 +422,7 @@ uniscribe_encode_char (font, c) | |||
| 428 | /* Use selected frame until API is updated to pass the frame. */ | 422 | /* Use selected frame until API is updated to pass the frame. */ |
| 429 | f = XFRAME (selected_frame); | 423 | f = XFRAME (selected_frame); |
| 430 | context = get_frame_dc (f); | 424 | context = get_frame_dc (f); |
| 431 | old_font = SelectObject (context, | 425 | old_font = SelectObject (context, FONT_COMPAT (font)->hfont); |
| 432 | ((W32FontStruct *)(font->font.font))->hfont); | ||
| 433 | 426 | ||
| 434 | retval = GetGlyphIndicesW (context, chars, 1, indices, | 427 | retval = GetGlyphIndicesW (context, chars, 1, indices, |
| 435 | GGI_MARK_NONEXISTING_GLYPHS); | 428 | GGI_MARK_NONEXISTING_GLYPHS); |
| @@ -494,8 +487,8 @@ add_opentype_font_name_to_list (logical_font, physical_font, font_type, | |||
| 494 | && font_type != TRUETYPE_FONTTYPE) | 487 | && font_type != TRUETYPE_FONTTYPE) |
| 495 | return 1; | 488 | return 1; |
| 496 | 489 | ||
| 497 | family = intern_downcase (logical_font->elfLogFont.lfFaceName, | 490 | family = font_intern_prop (logical_font->elfLogFont.lfFaceName, |
| 498 | strlen (logical_font->elfLogFont.lfFaceName)); | 491 | strlen (logical_font->elfLogFont.lfFaceName)); |
| 499 | if (! memq_no_quit (family, *list)) | 492 | if (! memq_no_quit (family, *list)) |
| 500 | *list = Fcons (family, *list); | 493 | *list = Fcons (family, *list); |
| 501 | 494 | ||
| @@ -819,6 +812,7 @@ font_table_error: | |||
| 819 | struct font_driver uniscribe_font_driver = | 812 | struct font_driver uniscribe_font_driver = |
| 820 | { | 813 | { |
| 821 | 0, /* Quniscribe */ | 814 | 0, /* Quniscribe */ |
| 815 | 0, /* case insensitive */ | ||
| 822 | w32font_get_cache, | 816 | w32font_get_cache, |
| 823 | uniscribe_list, | 817 | uniscribe_list, |
| 824 | uniscribe_match, | 818 | uniscribe_match, |
| @@ -866,7 +860,5 @@ syms_of_w32uniscribe () | |||
| 866 | register_font_driver (&uniscribe_font_driver, NULL); | 860 | register_font_driver (&uniscribe_font_driver, NULL); |
| 867 | } | 861 | } |
| 868 | 862 | ||
| 869 | #endif /* USE_FONT_BACKEND */ | ||
| 870 | |||
| 871 | /* arch-tag: 9530f0e1-7471-47dd-a780-94330af87ea0 | 863 | /* arch-tag: 9530f0e1-7471-47dd-a780-94330af87ea0 |
| 872 | (do not change this comment) */ | 864 | (do not change this comment) */ |