Mercurial > emacs
annotate src/w32font.h @ 108750:3339da3cfeb3
Redesign bidi-aware edge positions of glyph rows, fix bug #6036.
dispextern.h (struct glyph_row): New members minpos and maxpos.
(MATRIX_ROW_START_CHARPOS, MATRIX_ROW_START_BYTEPOS)
(MATRIX_ROW_END_CHARPOS, MATRIX_ROW_END_BYTEPOS): Reference minpos
and maxpos members instead of start.pos and end.pos, respectively.
xdisp.c (display_line): Compare IT_CHARPOS with the position in
row->start.pos, rather than with MATRIX_ROW_START_CHARPOS.
(cursor_row_p): Use row->end.pos rather than MATRIX_ROW_END_CHARPOS.
(try_window_reusing_current_matrix, try_window_id): Use
ROW->minpos rather than ROW->start.pos.
(init_from_display_pos, init_iterator): Use EMACS_INT for
character and byte positions.
(find_row_edges): Renamed from find_row_end. Accept additional
arguments for minimum and maximum buffer positions seen by
display_line for this row. Don't use iterator to find the
position following the maximum one; instead, increment the
position found by display_line directly. Fix logic; eol_pos
should be tested before the rest. Handle the case of characters
delivered from display vector (bug#6036). Fix tests related to
it->method. Handle the truncated_on_right_p rows.
(RECORD_MAX_MIN_POS): New macro.
(display_line): Use it to record the minimum and maximum buffer
positions for glyphs in the row being assembled. Record the
position of the newline that terminates the line. If word wrap is
in effect, restore minimum and maximum positions seen up to the
wrap point, when iterator returns to it.
(try_window_reusing_current_matrix): Give up if in bidi-reordered
row and cursor not already at point. Restore original pre-bidi
code for unidirectional buffers.
dispnew.c (increment_row_positions, check_matrix_invariants):
Increment and check row->start.pos and row->end.pos, in addition
to MATRIX_ROW_START_CHARPOS and MATRIX_ROW_END_CHARPOS.
.gdbinit (prowlims): Display row->minpos and row->maxpos.
Display truncated_on_left_p and truncated_on_right_p flags.
Formatting fixes.
(pmtxrows): Display the ordinal number of each row. Don't display
rows beyond the last one.
bidi.c (bidi_cache_iterator_state): Don't zero out new_paragraph:
it is not copied by bidi_copy_it.
author | Eli Zaretskii <eliz@gnu.org> |
---|---|
date | Sat, 22 May 2010 22:32:21 +0300 |
parents | 1d1d5d9bd884 |
children | 1dc371b29285 376148b31b5e |
rev | line source |
---|---|
91206 | 1 /* Shared GDI and Uniscribe Font backend declarations for the W32 API. |
106815 | 2 Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc. |
91206 | 3 |
4 This file is part of GNU Emacs. | |
5 | |
94994
29adfc9354e7
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
94916
diff
changeset
|
6 GNU Emacs is free software: you can redistribute it and/or modify |
91206 | 7 it under the terms of the GNU General Public License as published by |
94994
29adfc9354e7
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
94916
diff
changeset
|
8 the Free Software Foundation, either version 3 of the License, or |
29adfc9354e7
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
94916
diff
changeset
|
9 (at your option) any later version. |
91206 | 10 |
11 GNU Emacs is distributed in the hope that it will be useful, | |
12 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 GNU General Public License for more details. | |
15 | |
16 You should have received a copy of the GNU General Public License | |
94994
29adfc9354e7
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
94916
diff
changeset
|
17 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ |
91206 | 18 |
19 #ifndef EMACS_W32FONT_H | |
20 #define EMACS_W32FONT_H | |
21 | |
22 | |
23 /* Bit 17 of ntmFlags in NEWTEXTMETRIC is set for Postscript OpenType fonts, | |
92408
a371504924ef
(NTM_PS_OPENTYPE, NTM_TT_OPENTYPE, NTM_TYPE1): Define
Jason Rumney <jasonr@gnu.org>
parents:
91593
diff
changeset
|
24 bit 18 for Truetype OpenType fonts, bit 20 for Type1 fonts. */ |
a371504924ef
(NTM_PS_OPENTYPE, NTM_TT_OPENTYPE, NTM_TYPE1): Define
Jason Rumney <jasonr@gnu.org>
parents:
91593
diff
changeset
|
25 #ifndef NTM_PS_OPENTYPE |
a371504924ef
(NTM_PS_OPENTYPE, NTM_TT_OPENTYPE, NTM_TYPE1): Define
Jason Rumney <jasonr@gnu.org>
parents:
91593
diff
changeset
|
26 #define NTM_PS_OPENTYPE 0x00020000 |
a371504924ef
(NTM_PS_OPENTYPE, NTM_TT_OPENTYPE, NTM_TYPE1): Define
Jason Rumney <jasonr@gnu.org>
parents:
91593
diff
changeset
|
27 #endif |
a371504924ef
(NTM_PS_OPENTYPE, NTM_TT_OPENTYPE, NTM_TYPE1): Define
Jason Rumney <jasonr@gnu.org>
parents:
91593
diff
changeset
|
28 #ifndef NTM_TT_OPENTYPE |
a371504924ef
(NTM_PS_OPENTYPE, NTM_TT_OPENTYPE, NTM_TYPE1): Define
Jason Rumney <jasonr@gnu.org>
parents:
91593
diff
changeset
|
29 #define NTM_TT_OPENTYPE 0x00040000 |
a371504924ef
(NTM_PS_OPENTYPE, NTM_TT_OPENTYPE, NTM_TYPE1): Define
Jason Rumney <jasonr@gnu.org>
parents:
91593
diff
changeset
|
30 #endif |
a371504924ef
(NTM_PS_OPENTYPE, NTM_TT_OPENTYPE, NTM_TYPE1): Define
Jason Rumney <jasonr@gnu.org>
parents:
91593
diff
changeset
|
31 #ifndef NTM_TYPE1 |
a371504924ef
(NTM_PS_OPENTYPE, NTM_TT_OPENTYPE, NTM_TYPE1): Define
Jason Rumney <jasonr@gnu.org>
parents:
91593
diff
changeset
|
32 #define NTM_TYPE1 0x00100000 |
a371504924ef
(NTM_PS_OPENTYPE, NTM_TT_OPENTYPE, NTM_TYPE1): Define
Jason Rumney <jasonr@gnu.org>
parents:
91593
diff
changeset
|
33 #endif |
a371504924ef
(NTM_PS_OPENTYPE, NTM_TT_OPENTYPE, NTM_TYPE1): Define
Jason Rumney <jasonr@gnu.org>
parents:
91593
diff
changeset
|
34 |
a371504924ef
(NTM_PS_OPENTYPE, NTM_TT_OPENTYPE, NTM_TYPE1): Define
Jason Rumney <jasonr@gnu.org>
parents:
91593
diff
changeset
|
35 #define NTMFLAGS_OPENTYPE (NTM_PS_OPENTYPE | NTM_TT_OPENTYPE) |
91206 | 36 |
93860
0fecf07dfe3c
(struct w32_metric_cache): New struct.
Jason Rumney <jasonr@gnu.org>
parents:
93594
diff
changeset
|
37 struct w32_metric_cache |
0fecf07dfe3c
(struct w32_metric_cache): New struct.
Jason Rumney <jasonr@gnu.org>
parents:
93594
diff
changeset
|
38 { |
0fecf07dfe3c
(struct w32_metric_cache): New struct.
Jason Rumney <jasonr@gnu.org>
parents:
93594
diff
changeset
|
39 short lbearing, rbearing, width; |
0fecf07dfe3c
(struct w32_metric_cache): New struct.
Jason Rumney <jasonr@gnu.org>
parents:
93594
diff
changeset
|
40 unsigned char status; |
0fecf07dfe3c
(struct w32_metric_cache): New struct.
Jason Rumney <jasonr@gnu.org>
parents:
93594
diff
changeset
|
41 }; |
0fecf07dfe3c
(struct w32_metric_cache): New struct.
Jason Rumney <jasonr@gnu.org>
parents:
93594
diff
changeset
|
42 |
0fecf07dfe3c
(struct w32_metric_cache): New struct.
Jason Rumney <jasonr@gnu.org>
parents:
93594
diff
changeset
|
43 #define W32METRIC_NO_ATTEMPT 0 |
0fecf07dfe3c
(struct w32_metric_cache): New struct.
Jason Rumney <jasonr@gnu.org>
parents:
93594
diff
changeset
|
44 #define W32METRIC_SUCCESS 1 |
0fecf07dfe3c
(struct w32_metric_cache): New struct.
Jason Rumney <jasonr@gnu.org>
parents:
93594
diff
changeset
|
45 #define W32METRIC_FAIL 2 |
0fecf07dfe3c
(struct w32_metric_cache): New struct.
Jason Rumney <jasonr@gnu.org>
parents:
93594
diff
changeset
|
46 |
91206 | 47 /* The actual structure for a w32 font, that can be cast to struct font. |
48 The Uniscribe backend extends this. */ | |
49 struct w32font_info | |
50 { | |
51 struct font font; | |
97135
09abb4487286
* w32font.h (struct w32font_info): Use unicode version of textmetrics.
Jason Rumney <jasonr@gnu.org>
parents:
96343
diff
changeset
|
52 TEXTMETRICW metrics; |
92408
a371504924ef
(NTM_PS_OPENTYPE, NTM_TT_OPENTYPE, NTM_TYPE1): Define
Jason Rumney <jasonr@gnu.org>
parents:
91593
diff
changeset
|
53 unsigned int glyph_idx; |
93860
0fecf07dfe3c
(struct w32_metric_cache): New struct.
Jason Rumney <jasonr@gnu.org>
parents:
93594
diff
changeset
|
54 struct w32_metric_cache **cached_metrics; |
0fecf07dfe3c
(struct w32_metric_cache): New struct.
Jason Rumney <jasonr@gnu.org>
parents:
93594
diff
changeset
|
55 int n_cache_blocks; |
96327
2fc5aff56d81
* w32bdf.c, w32bdf.h: Remove obsolete files.
Jason Rumney <jasonr@gnu.org>
parents:
94994
diff
changeset
|
56 HFONT hfont; |
91206 | 57 }; |
58 | |
96343
5c8f2b7d28ae
* w32font.h (FONT_HANDLE, FONT_TEXTMETRIC): New macros.
Jason Rumney <jasonr@gnu.org>
parents:
96327
diff
changeset
|
59 /* Macros for getting OS specific information from a font struct. */ |
5c8f2b7d28ae
* w32font.h (FONT_HANDLE, FONT_TEXTMETRIC): New macros.
Jason Rumney <jasonr@gnu.org>
parents:
96327
diff
changeset
|
60 #define FONT_HANDLE(f) (((struct w32font_info *)(f))->hfont) |
5c8f2b7d28ae
* w32font.h (FONT_HANDLE, FONT_TEXTMETRIC): New macros.
Jason Rumney <jasonr@gnu.org>
parents:
96327
diff
changeset
|
61 #define FONT_TEXTMETRIC(f) (((struct w32font_info *)(f))->metrics) |
5c8f2b7d28ae
* w32font.h (FONT_HANDLE, FONT_TEXTMETRIC): New macros.
Jason Rumney <jasonr@gnu.org>
parents:
96327
diff
changeset
|
62 |
93860
0fecf07dfe3c
(struct w32_metric_cache): New struct.
Jason Rumney <jasonr@gnu.org>
parents:
93594
diff
changeset
|
63 #define CACHE_BLOCKSIZE 128 |
0fecf07dfe3c
(struct w32_metric_cache): New struct.
Jason Rumney <jasonr@gnu.org>
parents:
93594
diff
changeset
|
64 |
91254
21661755910b
(w32font_get_cache): Update declaration.
Jason Rumney <jasonr@gnu.org>
parents:
91213
diff
changeset
|
65 Lisp_Object w32font_get_cache P_ ((FRAME_PTR fe)); |
91206 | 66 Lisp_Object w32font_list_internal P_ ((Lisp_Object frame, |
67 Lisp_Object font_spec, | |
68 int opentype_only)); | |
69 Lisp_Object w32font_match_internal P_ ((Lisp_Object frame, | |
70 Lisp_Object font_spec, | |
71 int opentype_only)); | |
91210
4de7fe00ac26
(w32font_open_internal): New function.
Jason Rumney <jasonr@gnu.org>
parents:
91206
diff
changeset
|
72 int w32font_open_internal P_ ((FRAME_PTR f, Lisp_Object font_entity, |
94916
283ee643ce8b
(struct w32font_info): New member.
Kenichi Handa <handa@m17n.org>
parents:
93860
diff
changeset
|
73 int pixel_size, Lisp_Object font_object)); |
91206 | 74 void w32font_close P_ ((FRAME_PTR f, struct font *font)); |
75 int w32font_has_char P_ ((Lisp_Object entity, int c)); | |
76 int w32font_text_extents P_ ((struct font *font, unsigned *code, int nglyphs, | |
77 struct font_metrics *metrics)); | |
78 int w32font_draw P_ ((struct glyph_string *s, int from, int to, | |
79 int x, int y, int with_background)); | |
80 | |
93594
46b8fe649bbc
(uniscribe_check_otf): Declare.
Jason Rumney <jasonr@gnu.org>
parents:
92408
diff
changeset
|
81 |
46b8fe649bbc
(uniscribe_check_otf): Declare.
Jason Rumney <jasonr@gnu.org>
parents:
92408
diff
changeset
|
82 int uniscribe_check_otf P_ ((LOGFONT *font, Lisp_Object otf_spec)); |
46b8fe649bbc
(uniscribe_check_otf): Declare.
Jason Rumney <jasonr@gnu.org>
parents:
92408
diff
changeset
|
83 |
100409
4be3711ceff9
* w32font.c (intern_font_name): New function.
Jason Rumney <jasonr@gnu.org>
parents:
97135
diff
changeset
|
84 Lisp_Object intern_font_name P_ ((char *)); |
4be3711ceff9
* w32font.c (intern_font_name): New function.
Jason Rumney <jasonr@gnu.org>
parents:
97135
diff
changeset
|
85 |
91206 | 86 #endif |
91213 | 87 |
88 /* arch-tag: ef9d9675-a2a5-4d01-9526-815e9a3da7cb | |
89 (do not change this comment) */ |