--- /dev/null
+#
+# Copyright (c) 2014 Clerk Ma
+#
+# You may freely use, modify and/or distribute this file.
+#
+# makefle for linux (tested in ubuntu 14.04).
+#
+# apt-get install libkpathsea6 libkpathsea-dev
+# apt-get install libhpdf-2.2.1 libhpdf-dev
+# apt-get install libpng12-0 libpng12-dev
+# apt-get install zlib1g zlib1g-dev
+#
+
+CC = gcc
+CFLAGS = -DMSDOS -DTeX -DINITEX -DINI -Ilibmd5 -Ilibavl/libavl
+LDFLAGS = -lkpathsea -lhpdf -lpng -lz
+
+objects = yandytex.o itex.o openinou.o subroute.o local.o \
+ tex0.o tex1.o tex2.o tex3.o tex4.o \
+ tex5.o tex6.o tex7.o tex8.o tex9.o \
+ yandy_pool.o md5.o md5file.o \
+ yandy_pdf_backend.o avl.o
+
+headers = yandytex.h texd.h coerce.h texmf.h texmfmem.h
+
+yandytex: $(objects)
+ $(CC) -o yandytex $(objects) $(LDFLAGS)
+
+yandytex.o: yandytex.c $(headers)
+ $(CC) -c $(CFLAGS) yandytex.c
+
+itex.o: itex.c $(headers)
+ $(CC) -c $(CFLAGS) itex.c
+
+openinou.o: openinou.c $(headers)
+ $(CC) -c $(CFLAGS) openinou.c
+
+subroute.o: subroute.o $(headers)
+ $(CC) -c $(CFLAGS) subroute.c
+
+local.o: local.c $(headers)
+ $(CC) -c $(CFLAGS) local.c
+
+tex0.o: tex0.c $(headers)
+ $(CC) -c $(CFLAGS) tex0.c
+
+tex1.o: tex1.c $(headers)
+ $(CC) -c $(CFLAGS) tex1.c
+
+tex2.o: tex2.c $(headers)
+ $(CC) -c $(CFLAGS) tex2.c
+
+tex3.o: tex3.c $(headers)
+ $(CC) -c $(CFLAGS) tex3.c
+
+tex4.o: tex4.c $(headers)
+ $(CC) -c $(CFLAGS) tex4.c
+
+tex5.o: tex5.c $(headers)
+ $(CC) -c $(CFLAGS) tex5.c
+
+tex6.o: tex6.c $(headers)
+ $(CC) -c $(CFLAGS) tex6.c
+
+tex7.o: tex7.c $(headers)
+ $(CC) -c $(CFLAGS) tex7.c
+
+tex8.o: tex8.c $(headers)
+ $(CC) -c $(CFLAGS) tex8.c
+
+tex9.o: tex9.c $(headers)
+ $(CC) -c $(CFLAGS) tex9.c
+
+yandy_pool.o: yandy_pool.c $(headers)
+ $(CC) -c $(CFLAGS) yandy_pool.c
+
+md5.o: libmd5/md5.c $(headers)
+ $(CC) -c $(CFLAGS) libmd5/md5.c
+
+md5file.o: md5file.c $(headers)
+ $(CC) -c $(CFLAGS) md5file.c
+
+yandy_pdf_backend.o: yandy_pdf_backend.c $(headers)
+ $(CC) -c $(CFLAGS) yandy_pdf_backend.c
+
+avl.o: libavl/libavl/avl.c $(headers)
+ $(CC) -c $(CFLAGS) libavl/libavl/avl.c
+
+.PHONY: clean
+
+clean:
+ rm yandytex *.o
if (s >= str_ptr)
s = 259; /* ??? */
- else
+ else
{
if (s < 256)
{
incr(j);
}
}
+
new_line_char = nl; /* restore eol */
return;
}
print_char(*s++);
}
/* sec 0060 */
-// print string number s from string pool by calling print_
void slow_print_ (integer s)
{
pool_pointer j;
}
}
/* sec 0062 */
-// print newline followed by string number s (unless at start of line)
void print_nl_ (const char * s)
{
if (((term_offset > 0) && (odd(selector))) ||
print_string(s);
}
/* sec 0063 */
-// print string number s preceded by escape character
void print_esc_ (const char * s)
{
integer c;
print_esc("NONEXISTENT.");
else
{
- print_esc(""); print(text(p));
+ print_esc("");
+ print(text(p));
print_char(' ');
}
}
print(p - active_base);
else if (p < null_cs)
{
- print_esc(""); print(p - single_base);
+ print_esc("");
+ print(p - single_base);
}
else
{
/* sec 1355 */
void print_write_whatsit_(str_number s, halfword p)
{
- print_esc(""); print(s);
+ print_esc("");
+ print(s);
+
if (write_stream(p) < 16)
print_int(write_stream(p));
else if (write_stream(p) == 16)
}
}
/* sec 0043 */
-// Make string from str_start[str_ptr] to pool_ptr
str_number make_string (void)
{
#ifdef ALLOCATESTRING
return ((a + 1) / 2);
}
/* sec 0103 */
-/* This has some minor speedup changes - no real advantage probably ... */
void print_scaled_(scaled s)
{
scaled delta;
integer a;
a = small_fam(p) * 256 + small_char(p);
- a = a * 4096 + large_fam(p) * 256 + large_char(p);
+ a = a * 0x1000 + large_fam(p) * 256 + large_char(p);
if (a < 0)
print_int(a);
if (cur_length > depth_threshold)
{
-/* if (p > 0) */ /* was p>null !!! line 3662 in tex.web */
if (p != 0) /* fixed 94/Mar/23 BUG FIX NOTE: still not fixed in 3.14159 ! */
- print_string(" []");
+ print_string(" []");
+
return;
}
}
p = link(p);
}
-}
+}
\ No newline at end of file
error();
}
}
-/* NOTE: the above use of /fontdimen0 to access the checksum is a kludge */
-/* In future would be better to do this by allocating one more slot for */
-/* for parameters when a font is read rather than carry checksum separately */
-/* The above gets the value byte order reversed ... 98/Oct/5 */
/* sec 0413 */
void scan_something_internal_(small_number level, bool negative)
{
else if ((cur_val_level >= glue_val) && (cur_val_level <= mu_val))
add_glue_ref(cur_val);
}
-/*****************************************************************************/
-/* Moved here to avoid question about pragma optimize 96/Sep/12 */
/* sec 0341 */
void get_next (void)
{
align_state = 1000000L;
goto lab20;
}
-}
-//#pragma optimize ("", on) /* 96/Sep/12 */
\ No newline at end of file
+}
\ No newline at end of file
pool_ptr = str_start[str_ptr];
}
-/* noew returns -1 if it fails */
/* sec 1370 */
void write_out_(halfword p)
{
if (total_pages != 1)
print_char('s');
- print_string(", ");
+ //print_string(", ");
//print_int(dvi_offset + dvi_ptr);
- print_int(yandy_pdf->sig_bytes);
- print_string(" bytes).");
- //print_string(").");
+ //print_int(yandy_pdf->mmgr->mpool->used_size);
+ //print_string(" bytes).");
+ print_string(").");
b_close(dvi_file);
}
void pdf_font_def(internal_font_number f)
{
+ /*
int k;
const char * fnt_name;
char * afm_name;
yandy_font[k] = HPDF_GetFont(yandy_pdf, fnt_name, NULL);
}
}
-
- HPDF_Page_SetFontAndSize(yandy_page, yandy_font[k], (font_size[f] / 65535));
+ */
+ HPDF_Page_SetFontAndSize(yandy_page, yandy_font[0], (font_size[f] / 65535));
}
void pdf_ship_out(halfword p)
}
yandy_page = HPDF_AddPage (yandy_pdf);
+ HPDF_Page_SetFontAndSize(yandy_page, yandy_font[0], 10);
HPDF_Page_SetSize (yandy_page, HPDF_PAGE_SIZE_A4, HPDF_PAGE_PORTRAIT);
cur_v = height(p) + v_offset;
if (f != dvi_f)
{
- pdf_font_def(f);
-
if (!font_used[f])
{
font_used[f] = true;
dvi_f = f;
}
- HPDF_Page_SetFontAndSize (yandy_page, yandy_font[dvi_f], 10);
- HPDF_Page_BeginText(yandy_page);
+ HPDF_Page_BeginText(yandy_page);HPDF_Page_SetFontAndSize(yandy_page, yandy_font[0], 10);
HPDF_Page_MoveTextPos(yandy_page, pdf_sp_to_bp(cur_h) + 72, (841.89 - (pdf_sp_to_bp(cur_v) + 72)));
HPDF_Page_ShowText(yandy_page, pdf_char_to_string(c));
HPDF_Page_EndText(yandy_page);