~mdw
/
sgt
/
halibut
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Apply r6972 from my other copy of deflate.c: don't lose the BFINAL bit
[sgt/halibut]
/
bk_paper.c
diff --git
a/bk_paper.c
b/bk_paper.c
index
ae5a246
..
e70ecf7
100644
(file)
--- a/
bk_paper.c
+++ b/
bk_paper.c
@@
-49,13
+49,10
@@
*
* - title pages
*
*
* - title pages
*
- * - ability to
import other Type 1 font
s
+ * - ability to
use Type 1 fonts without AFM file
s
* * we need to parse the font to extract its metrics
* * we need to parse the font to extract its metrics
- * * then we pass the font bodily to both PS and PDF so it can
- * be included in the output file
*
* - character substitution for better typography?
*
* - character substitution for better typography?
- * * fi, fl, ffi, ffl ligatures
* * use real ellipsis rather than ...
* * a hyphen in a word by itself might prefer to be an en-dash
* * (Americans might even want a convenient way to use an
* * use real ellipsis rather than ...
* * a hyphen in a word by itself might prefer to be an en-dash
* * (Americans might even want a convenient way to use an
@@
-1106,6
+1103,7
@@
static para_data *make_para_data(int ptype, int paux, int indent, int rmargin,
pdata->rect_type = RECT_NONE;
pdata->contents_entry = NULL;
pdata->justification = JUST;
pdata->rect_type = RECT_NONE;
pdata->contents_entry = NULL;
pdata->justification = JUST;
+ pdata->extraflags = 0;
/*
* Choose fonts for this paragraph.
/*
* Choose fonts for this paragraph.
@@
-1458,6
+1456,14
@@
static int utoglyph(font_info const *fi, wchar_t u) {
return (u < 0 || u > 0xFFFF ? NOGLYPH : fi->bmp[u]);
}
return (u < 0 || u > 0xFFFF ? NOGLYPH : fi->bmp[u]);
}
+void listfonts(void) {
+ font_info const *fi;
+
+ init_std_fonts();
+ for (fi = all_fonts; fi; fi = fi->next)
+ printf("%s\n", fi->name);
+}
+
static font_data *make_std_font(font_list *fontlist, char const *name)
{
font_info const *fi;
static font_data *make_std_font(font_list *fontlist, char const *name)
{
font_info const *fi;
@@
-1709,7
+1715,6
@@
static void wrap_paragraph(para_data *pdata, word *words,
for (p = wrapping; p; p = p->next) {
line_data *ldata;
for (p = wrapping; p; p = p->next) {
line_data *ldata;
- word *wd;
int len, wid, spaces;
ldata = snew(line_data);
int len, wid, spaces;
ldata = snew(line_data);
@@
-1734,7
+1739,6
@@
static void wrap_paragraph(para_data *pdata, word *words,
spaces = 0;
len = paper_width_list(&ctx, ldata->first, ldata->end, &spaces);
wid = (p == wrapping ? w - i1 : w - i2);
spaces = 0;
len = paper_width_list(&ctx, ldata->first, ldata->end, &spaces);
wid = (p == wrapping ? w - i1 : w - i2);
- wd = ldata->first;
ldata->hshortfall = wid - len;
ldata->nspaces = spaces;
ldata->hshortfall = wid - len;
ldata->nspaces = spaces;
@@
-2209,6
+2213,7
@@
static int render_text(page_data *page, para_data *pdata, line_data *ldata,
FONT_CODE);
if (style == word_Code || style == word_WeakCode) flags |= RS_NOLIG;
FONT_CODE);
if (style == word_Code || style == word_WeakCode) flags |= RS_NOLIG;
+ flags |= pdata->extraflags;
if (type == word_Normal) {
str = text->text;
if (type == word_Normal) {
str = text->text;
@@
-2482,6
+2487,7
@@
static para_data *code_paragraph(int indent, word *words, paper_conf *conf)
pdata->rect_type = RECT_NONE;
pdata->contents_entry = NULL;
pdata->justification = LEFT;
pdata->rect_type = RECT_NONE;
pdata->contents_entry = NULL;
pdata->justification = LEFT;
+ pdata->extraflags = RS_NOLIG;
for (; words; words = words->next) {
wchar_t *t, *e, *start;
for (; words; words = words->next) {
wchar_t *t, *e, *start;
@@
-2612,6
+2618,7
@@
static para_data *rule_paragraph(int indent, paper_conf *conf)
pdata->rect_type = RECT_RULE;
pdata->contents_entry = NULL;
pdata->justification = LEFT;
pdata->rect_type = RECT_RULE;
pdata->contents_entry = NULL;
pdata->justification = LEFT;
+ pdata->extraflags = 0;
standard_line_spacing(pdata, conf);
standard_line_spacing(pdata, conf);