summaryrefslogtreecommitdiff
path: root/dviware/beebe/src/setchar.h
diff options
context:
space:
mode:
Diffstat (limited to 'dviware/beebe/src/setchar.h')
-rw-r--r--dviware/beebe/src/setchar.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/dviware/beebe/src/setchar.h b/dviware/beebe/src/setchar.h
new file mode 100644
index 0000000000..b6b0fc14e6
--- /dev/null
+++ b/dviware/beebe/src/setchar.h
@@ -0,0 +1,50 @@
+/* -*-C-*- setchar.h */
+/*-->setchar*/
+/**********************************************************************/
+/****************************** setchar *******************************/
+/**********************************************************************/
+
+void
+setchar(c, update_h)
+register BYTE c;
+register BOOLEAN update_h;
+{
+ register struct char_entry *tcharptr; /* temporary char_entry pointer */
+
+ if (DBGOPT(DBG_SET_TEXT))
+ {
+ (void)fprintf(stderr,"setchar('");
+ if (isprint(c))
+ (void)putc(c,stderr);
+ else
+ (void)fprintf(stderr,"\\%03o",(int)c);
+ (void)fprintf(stderr,"'<%d>) (hh,vv) = (%ld,%ld) font name <%s>",
+ (int)c, (long)hh, (long)vv, fontptr->n);
+ NEWLINE(stderr);
+ }
+
+ tcharptr = &(fontptr->ch[c]);
+ if (((hh - tcharptr->xoffp + tcharptr->pxlw) <= XSIZE)
+ && (hh >= 0)
+ && (vv <= YSIZE)
+ && (vv >= 0))
+ { /* character fits entirely on page */
+ moveto( hh, (COORDINATE)(YSIZE-vv));
+ dispchar(c);
+ }
+ else if (DBGOPT(DBG_OFF_PAGE) && !quiet)
+ { /* character is off page -- discard it */
+ (void)fprintf(stderr,
+ "setchar(): Char %c [10#%3d 8#%03o 16#%02x] off page.",
+ isprint(c) ? c : '?',c,c,c);
+ NEWLINE(stderr);
+ }
+
+ if (update_h)
+ {
+ h += (INT32)tcharptr->tfmw;
+ hh += (COORDINATE)tcharptr->pxlw;
+ hh = (COORDINATE)(fixpos(hh-lmargin,h,conv) + lmargin);
+ }
+}
+