changeset 67732:caacdc1a999e

(XCharStruct): Remove member `valid_p'. (STORE_XCHARSTRUCT): Don't set member `valid_p'. (XCharStructRow): New typedef. (XCHARSTRUCTROW_CHAR_VALID_P, XCHARSTRUCTROW_SET_CHAR_VALID): New macros. (struct MacFontStruct): Add member `bounds'. Remove member `per_char'. All uses for QuichDraw Text fonts are changed to `bounds.per_char'. ATSUI font bounds are represented as an array `bounds.rows' of XCharStructRow's, each of which consists of a bitmap of valid entries and an array of char bounds.
author YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
date Thu, 22 Dec 2005 08:17:01 +0000
parents c1eaa6ea0192
children 330ac31a0c82
files src/macgui.h
diffstat 1 files changed, 17 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/macgui.h	Thu Dec 22 08:16:53 2005 +0000
+++ b/src/macgui.h	Thu Dec 22 08:17:01 2005 +0000
@@ -109,7 +109,6 @@
 #if 0
   unsigned short attributes;	/* per char flags (not predefined) */
 #endif
-  unsigned valid_p : 1;
 } XCharStruct;
 
 #define STORE_XCHARSTRUCT(xcs, w, bds)			\
@@ -117,8 +116,19 @@
    (xcs).lbearing = (bds).left,				\
    (xcs).rbearing = (bds).right,			\
    (xcs).ascent = -(bds).top,				\
-   (xcs).descent = (bds).bottom,			\
-   (xcs).valid_p = 1)
+   (xcs).descent = (bds).bottom)
+
+typedef struct
+{
+  char valid_bits[0x100 / 8];
+  XCharStruct per_char[0x100];
+} XCharStructRow;
+
+#define XCHARSTRUCTROW_CHAR_VALID_P(row, byte2) \
+  ((row)->valid_bits[(byte2) / 8] & (1 << (byte2) % 8))
+
+#define XCHARSTRUCTROW_SET_CHAR_VALID(row, byte2) \
+  ((row)->valid_bits[(byte2) / 8] |= (1 << (byte2) % 8))
 
 struct MacFontStruct {
   char *full_name;
@@ -157,7 +167,10 @@
 #endif /* 0 */
   XCharStruct min_bounds;  /* minimum bounds over all existing char */
   XCharStruct max_bounds;  /* maximum bounds over all existing char */
-  XCharStruct *per_char;   /* first_char to last_char information */
+  union {
+    XCharStruct *per_char; /* first_char to last_char information */
+    XCharStructRow **rows; /* first row to last row information */
+  } bounds;
   int ascent;              /* logical extent above baseline for spacing */
   int descent;             /* logical decent below baseline for spacing */
 };