# HG changeset patch # User YAMAMOTO Mitsuharu # Date 1135239421 0 # Node ID caacdc1a999e0db21005c6f7fcbda36a283ec6e5 # Parent c1eaa6ea0192b18c03880775146b9d7f2b137b34 (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. diff -r c1eaa6ea0192 -r caacdc1a999e src/macgui.h --- 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 */ };