X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/halibut/blobdiff_plain/36e8f0f56f85d20f939091301d65c7f4f6889998..26c8c119efd44804c7b27f8637c69eda63f0c189:/paper.h diff --git a/paper.h b/paper.h index 1a6f9f1..652fa7e 100644 --- a/paper.h +++ b/paper.h @@ -87,14 +87,10 @@ struct font_info_Tag { */ const char *name; /* - * The file containing this font, if any. + * Pointer to data about the file containing the font, if any. */ - FILE *fp; - filepos pos; - /* - * Lengths of the unencrypted and encrypted portions of the font. - */ - long length1, length2; + void *fontfile; + enum { TYPE1, TRUETYPE } filetype; /* A tree of glyph_widths */ tree234 *widths; /* A tree of kern_pairs */ @@ -225,6 +221,11 @@ struct para_data_Tag { JUST, LEFT, RIGHT } justification; /* + * Sometimes (in code paragraphs) we want to override the flags + * passed to render_string(). + */ + unsigned extraflags; + /* * For constructing the page outline. */ int outline_level; /* 0=title 1=C 2=H 3=S 4=S2... */ @@ -386,19 +387,42 @@ glyph glyph_intern(char const *); char const *glyph_extern(glyph); wchar_t ps_glyph_to_unicode(glyph); extern const char *const ps_std_glyphs[]; +extern glyph const tt_std_glyphs[]; void init_std_fonts(void); const int *ps_std_font_widths(char const *fontname); const kern_pair *ps_std_font_kerns(char const *fontname); /* - * Function from bk_pdf.c borrowed by bk_ps.c + * Functions exported from bk_pdf.c */ +typedef struct object_Tag object; +typedef struct objlist_Tag objlist; +object *new_object(objlist *list); +void objtext(object *o, char const *text); +void objstream(object *o, char const *text); +void objstream_len(object *o, char const *text, size_t len); char *pdf_outline_convert(wchar_t *s, int *len); /* + * Function exported from bk_ps.c + */ +void ps_token(FILE *fp, int *cc, char const *fmt, ...); + +/* * Backend functions exported by in_pf.c */ void pf_part1(font_info *fi, char **bufp, size_t *lenp); void pf_part2(font_info *fi, char **bufp, size_t *lenp); +void pf_writeps(font_info const *fi, FILE *ofp); + +/* + * Backend functions exported by in_sfnt.c + */ +typedef struct sfnt_Tag sfnt; +glyph sfnt_indextoglyph(sfnt *sf, unsigned idx); +unsigned sfnt_glyphtoindex(sfnt *sf, glyph g); +unsigned sfnt_nglyphs(sfnt *sf); +void sfnt_writeps(font_info const *fi, FILE *ofp); +void sfnt_data(font_info *fi, char **bufp, size_t *lenp); #endif