From 5aa98a4b030febc0aa0c75d987bb3dc9e96ae47a Mon Sep 17 00:00:00 2001 From: ben Date: Sun, 7 Jan 2007 11:48:58 +0000 Subject: [PATCH] Add a mechanism for disabling ligature substitution for an entire paragraph and apply it to code paragraphs. git-svn-id: svn://svn.tartarus.org/sgt/halibut@7069 cda61777-01e9-0310-a592-d414129be87e --- bk_paper.c | 4 ++++ paper.h | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/bk_paper.c b/bk_paper.c index ae5a246..ab6472e 100644 --- a/bk_paper.c +++ b/bk_paper.c @@ -1106,6 +1106,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->extraflags = 0; /* * Choose fonts for this paragraph. @@ -2209,6 +2210,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; + flags |= pdata->extraflags; if (type == word_Normal) { str = text->text; @@ -2482,6 +2484,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->extraflags = RS_NOLIG; for (; words; words = words->next) { wchar_t *t, *e, *start; @@ -2612,6 +2615,7 @@ static para_data *rule_paragraph(int indent, paper_conf *conf) pdata->rect_type = RECT_RULE; pdata->contents_entry = NULL; pdata->justification = LEFT; + pdata->extraflags = 0; standard_line_spacing(pdata, conf); diff --git a/paper.h b/paper.h index 1a6f9f1..a15cbc7 100644 --- a/paper.h +++ b/paper.h @@ -225,6 +225,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... */ -- 2.11.0