[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] Font Baselines for 3.21
From: |
Chip Salzenberg |
Subject: |
[PATCH] Font Baselines for 3.21 |
Date: |
Sun, 14 May 2000 14:56:54 -0700 |
User-agent: |
Mutt/1.2i |
I've updated my font-baseline patch for 3.21. Here it is, for your
reading and/or formatting pleasure.
Index: z24.c
@@ -736,9 +736,12 @@ void PrintWord(OBJECT x, int hpos, int v
*q = '\0';
- /* move to coordinate of x */
cmp = finfo[word_font(x)].cmp_table;
composite = finfo[word_font(x)].composite;
+
+ /* move to coordinate of x */
+#if JAGGED_FONT_CHANGES
debug1(DGP, DDD, " currentxheight2 = %d", currentxheight2);
vpos = vpos - currentxheight2;
+#endif
if( cpexists && currenty == vpos )
{ printnum(hpos, out_fp);
@@ -878,6 +881,8 @@ void PrintWord(OBJECT x, int hpos, int v
/* move to coordinate of x */
+#if JAGGED_FONT_CHANGES
debug1(DGP, DDD, " currentxheight2 = %d", currentxheight2);
vpos = vpos - currentxheight2;
+#endif
if( cpexists && (currenty == vpos) && PDFHasValidTextMatrix() )
{ /* printnum(hpos, out_fp); */
Index: z37.c
@@ -362,7 +362,15 @@ static void ReadCharMetrics(OBJECT face,
case POSTSCRIPT:
case PDF: fnt[ch].left = llx;
- fnt[ch].down = lly - xheight2;
+ fnt[ch].down = lly
+#if JAGGED_FONT_CHANGES
+ - xheight2
+#endif
+ ;
fnt[ch].right = wx;
- fnt[ch].up = ury - xheight2;
+ fnt[ch].up = ury
+#if JAGGED_FONT_CHANGES
+ - xheight2
+#endif
+ ;
fnt[ch].last_adjust =
(urx == 0 || wx == 0 || fixed_pitch) ? 0 : urx - wx;
@@ -1018,5 +1026,9 @@ static OBJECT FontRead(FULL_CHAR *family
finfo[font_count].font_table = first_size;
finfo[font_count].original_font = face;
- finfo[font_count].underline_pos = xheight2 - under_pos;
+ finfo[font_count].underline_pos =
+#if JAGGED_FONT_CHANGES
+ xheight2
+#endif
+ - under_pos;
finfo[font_count].underline_thick = under_thick;
finfo[font_count].size_table = fnt;
Index: z38.c
@@ -455,6 +455,10 @@ OBJECT MapSmallCaps(OBJECT x, STYLE *sty
{ MAPPING m; int i; OBJECT new_y, new_x, new_acat, tmp;
FULL_CHAR buff[MAX_BUFF], *uc, *p, *q;
- FONT_NUM small_font; FULL_LENGTH vshift; int state; STYLE new_style;
+ FONT_NUM small_font; int state; STYLE new_style;
+#if JAGGED_FONT_CHANGES
+ FULL_LENGTH vshift;
+#endif
static OBJECT font_change_word = nilobj;
+
assert( is_word(type(x)), "MapSmallCaps: !is_word(type(x))" );
debug2(DCM, D, "MapSmallCaps(%s %s)", Image(type(x)), string(x));
@@ -501,5 +505,7 @@ OBJECT MapSmallCaps(OBJECT x, STYLE *sty
FontChange(&new_style, font_change_word);
small_font = font(new_style);
+#if JAGGED_FONT_CHANGES
vshift = FontHalfXHeight(word_font(x)) - FontHalfXHeight(small_font);
+#endif
state = ALL_TRANS;
@@ -521,5 +527,7 @@ OBJECT MapSmallCaps(OBJECT x, STYLE *sty
FontChange(&new_style, font_change_word);
small_font = font(new_style);
+#if JAGGED_FONT_CHANGES
vshift = FontHalfXHeight(word_font(x)) - FontHalfXHeight(small_font);
+#endif
/* make a new WORD out of the current contents of buff */
@@ -550,7 +558,12 @@ OBJECT MapSmallCaps(OBJECT x, STYLE *sty
else
{
- /* make a new @VShift WORD out of the current contents of buff */
+ /* make a new WORD out of the current contents of buff */
tmp = DoWord(buff, q, x, small_font);
+#if JAGGED_FONT_CHANGES
+ /* @VShift it */
new_y = DoVShift(x, vshift, tmp);
+#else
+ new_y = tmp;
+#endif
/* construct the skeleton of the result to replace x */
@@ -600,7 +613,12 @@ OBJECT MapSmallCaps(OBJECT x, STYLE *sty
else
{
- /* make a new @VShift WORD out of the current contents of buff */
+ /* make a new WORD out of the current contents of buff */
tmp = DoWord(buff, q, x, small_font);
+#if JAGGED_FONT_CHANGES
+ /* @VShift it */
new_y = DoVShift(x, vshift, tmp);
+#else
+ new_y = tmp;
+#endif
/* link the new word into the growing structure that replaces x */
@@ -630,7 +648,13 @@ OBJECT MapSmallCaps(OBJECT x, STYLE *sty
case ALL_TRANS:
- /* make a new @VShift WORD and replace x with it */
+ /* make a new WORD */
tmp = DoWord(buff, q, x, small_font);
+#if JAGGED_FONT_CHANGES
+ /* @VShift it */
new_x = DoVShift(x, vshift, tmp);
+#else
+ new_x = tmp;
+#endif
+ /* replace x with it */
ReplaceNode(new_x, x);
Dispose(x);
@@ -652,7 +676,13 @@ OBJECT MapSmallCaps(OBJECT x, STYLE *sty
case MIXED_TRANS:
- /* make a new @VShift WORD, add to new_acat, and replace x */
+ /* make a new WORD */
tmp = DoWord(buff, q, x, small_font);
+#if JAGGED_FONT_CHANGES
+ /* @VShift it */
new_y = DoVShift(x, vshift, tmp);
+#else
+ new_y = tmp;
+#endif
+ /* add to new_acat, and replace x */
Link(new_acat, new_y);
ReplaceNode(new_x, x);
--
Chip Salzenberg - a.k.a. - <address@hidden>
"I wanted to play hopscotch with the impenetrable mystery of existence,
but he stepped in a wormhole and had to go in early." // MST3K