[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: magicpointその後
In message <20031210.123652.63105725.taca@back-street.net>
on Wed, 10 Dec 2003 12:36:52 +0900 (JST),
Takahiro Kambe <taca@back-street.net> wrote:
> > http://www.jp.netbsd.org/ja/JP/ml/tech-pkg-ja/200311/msg00007.html
> この辺のパッチは調べて当ててあります。
拾ったものは、次のようになります。(直接は関係ないのも入ってますが。)
--
神戸 隆博(かんべ たかひろ) at 仕事場
--- draw.c.orig 2003-05-14 16:45:35.000000000 +0900
+++ draw.c
@@ -4498,13 +4498,13 @@ xft_draw_fragment(state, p, len, registr
struct ctrl *cp;
char *fontname = NULL;
int i;
- static char etab[3][20] = { "iso2022jp", "gb2312", "ksc5601"};
+#ifdef HAVE_ICONV
+ static char etab[3][20] = { "iso-2022-jp", "gb2312", "ksc5601"};
static char rtab[3][20] = { "jisx208", "gb2312", "ksc5601"};
static char prefix[3][20] = { "\033$B", "\033$A", "\033$(C"};
char buf16[1024], *p16;
char out16[1024], *o16;
int ileft, oleft;
-#ifdef HAVE_ICONV
static iconv_t icv[3];
#endif
@@ -4529,8 +4529,8 @@ xft_draw_fragment(state, p, len, registr
}
if (i == 3) return NULL; /* cannot find codeset */
sprintf(buf16, "%s%s\0", prefix[i], p);
- if (!icv[i]) icv[i] = iconv_open("UTF8", etab[i]);
- if (icv[i] < 0){
+ if (icv[i] == (iconv_t)0) icv[i] = iconv_open("UTF-8", etab[i]);
+ if (icv[i] == (iconv_t)-1) {
fprintf(stderr, "your iconv doesn't support %s\n", etab[i]);
return NULL;
}
--- image/rotate.c.orig 1998-12-28 17:23:22.000000000 +0900
+++ image/rotate.c
@@ -69,7 +69,8 @@ int degrees; /* Number of degrees
{ fprintf(stderr, " Rotating image by %d degrees...", degrees);
fflush(stderr);
}
- sprintf(buf, "%s (rotated by %d degrees)", simage->title, degrees);
+ if (simage->title)
+ sprintf(buf, "%s (rotated by %d degrees)", simage->title, degrees);
image1 = simage;
do {
--- image/zoom.c.orig 1999-11-28 23:35:16.000000000 +0900
+++ image/zoom.c
@@ -60,24 +60,28 @@ Image *zoom(oimage, xzoom, yzoom, verbos
if (xzoom == 0.0) {
if (verbose)
fprintf(stderr, " Zooming image Y axis by %0.2f%%...", yzoom);
- sprintf(buf, "%s (Y zoom %0.2f%%)", oimage->title, yzoom);
+ if (oimage->title)
+ sprintf(buf, "%s (Y zoom %0.2f%%)", oimage->title, yzoom);
}
else if (yzoom == 0.0) {
if (verbose)
fprintf(stderr, " Zooming image X axis by %0.2f%%...", xzoom);
- sprintf(buf, "%s (X zoom %0.2f%%)", oimage->title, xzoom);
+ if (oimage->title)
+ sprintf(buf, "%s (X zoom %0.2f%%)", oimage->title, xzoom);
}
else if (xzoom == yzoom) {
if (verbose)
fprintf(stderr, " Zooming image by %0.2f%%...", xzoom);
- sprintf(buf, "%s (%d%% zoom)", oimage->title, xzoom);
+ if (oimage->title)
+ sprintf(buf, "%s (%d%% zoom)", oimage->title, xzoom);
}
else {
if (verbose)
fprintf(stderr, " Zooming image X axis by %0.2f%% and Y axis by %0.2f%%...",
xzoom, yzoom);
- sprintf(buf, "%s (X zoom %0.2f%% Y zoom %0.2f%%)", oimage->title,
- xzoom, yzoom);
+ if (oimage->title)
+ sprintf(buf, "%s (X zoom %0.2f%% Y zoom %0.2f%%)", oimage->title,
+ xzoom, yzoom);
}
if (verbose)
fflush(stderr);
--- parse.c.orig 2003-06-14 19:22:56.000000000 +0900
+++ parse.c
@@ -848,7 +848,7 @@ thirdpass()
tmpint[2]->cti_value = DEFAULT_VGAP;
tmpint[3] = ctlalloc1(CTL_QUALITY);
tmpint[3]->cti_value = DEFAULT_BQUALITY;
-#ifdef XFT2
+#ifdef USE_XFT2
tmpint[4] = ctlalloc1(CTL_OPAQUE);
tmpint[4]->cti_value = DEFAULT_OPAQUE;
#endif
@@ -1045,8 +1045,20 @@ thirdpass()
continue;
line = page_attribute[page].pg_linenum;
for (l = 0; l <= line; l++) {
+ int contseen;
+ contseen = 0;
ch = &page_control[page][l];
- if (default_control[l]) {
+ /*
+ * if this line contains CTL_CONT, we don't add
+ * default directive to this line
+ */
+ for (cp = page_control[page][l]; cp; cp = cp->ct_next) {
+ if (cp->ct_op == CTL_CONT) {
+ contseen++;
+ break;
+ }
+ }
+ if (default_control[l] && !contseen) {
ctlinsert(ch, ctlcopy(default_control[l]));
}
}