summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Rumney <jasonr@gnu.org>2008-04-08 14:29:39 +0000
committerJason Rumney <jasonr@gnu.org>2008-04-08 14:29:39 +0000
commit56a70cca39b4a6bf336dcc97ff20f7481046024b (patch)
tree85f117d8f08757fedddec88fdb77a122d725a6b4
parent3d3d1efc2ed34234bac016f472f9b31d812738e2 (diff)
downloademacs-56a70cca39b4a6bf336dcc97ff20f7481046024b.tar.gz
(struct w32_metric_cache): New struct.
(w32font_info): Use it. (W32METRIC_NO_ATTEMPT, W32METRIC_SUCCESS, W32METRIC_FAIL) (CACHE_BLOCKSIZE): New constants.
-rw-r--r--src/ChangeLog5
-rw-r--r--src/w32font.h15
2 files changed, 19 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 4f1f087d00d..30ea46bc470 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,10 @@
2008-04-08 Jason Rumney <jasonr@gnu.org>
+ * w32font.h (struct w32_metric_cache): New struct.
+ (w32font_info): Use it.
+ (W32METRIC_NO_ATTEMPT, W32METRIC_SUCCESS, W32METRIC_FAIL)
+ (CACHE_BLOCKSIZE): New constants.
+
* w32font.c (Qja, Qko, Qzh): New symbols.
(syms_of_w32font): Initialise them.
(font_matches_spec): Use them to filter by language.
diff --git a/src/w32font.h b/src/w32font.h
index 9bd7546e057..6345d59c71f 100644
--- a/src/w32font.h
+++ b/src/w32font.h
@@ -36,6 +36,16 @@ Boston, MA 02110-1301, USA. */
#define NTMFLAGS_OPENTYPE (NTM_PS_OPENTYPE | NTM_TT_OPENTYPE)
+struct w32_metric_cache
+{
+ short lbearing, rbearing, width;
+ unsigned char status;
+};
+
+#define W32METRIC_NO_ATTEMPT 0
+#define W32METRIC_SUCCESS 1
+#define W32METRIC_FAIL 2
+
/* The actual structure for a w32 font, that can be cast to struct font.
The Uniscribe backend extends this. */
struct w32font_info
@@ -43,9 +53,12 @@ struct w32font_info
struct font font;
TEXTMETRIC metrics;
unsigned int glyph_idx;
- struct font_metrics ascii_metrics[128];
+ struct w32_metric_cache **cached_metrics;
+ int n_cache_blocks;
};
+#define CACHE_BLOCKSIZE 128
+
Lisp_Object w32font_get_cache P_ ((FRAME_PTR fe));
Lisp_Object w32font_list_internal P_ ((Lisp_Object frame,
Lisp_Object font_spec,